The easiest way to determine what native DB type can be mapped to a
given JDBC type is to check types.xml file located in cayenne.jar and
cayenne sources folder in each DB adapter package. In our case
checking org/objectstyle/cayenne/dba/oracle/types.xml BOOLEAN works
with Oracle INTEGER. Conversion between objects and Oracle is fully
automatic.
Alternatively, in case you want to use something non-standard, you
can implement an ExtendedType to do an arbitrary conversions of values:
http://objectstyle.org/cayenne/userguide/access-stack/extended-
types.html
Andrus
On Dec 13, 2005, at 7:11 PM, jah.volcano wrote:
> I would like to know the reccomended way to set up Cayenne (cay)
> mapping datatypes for Oracle. I pose some possible types below and
> would like to know if they are a good idea or not. Is there any
> documentation on this? I did not see any that would help me.
>
> I am using cay 1.2M8 and have had difficulty with the boolean type
> in MySQL and assume the same will apply in Oracle. When cay reads
> a DB value of 't', 'f', or null, the response seems to always be
> null. In MySQL, I switched the type to BOOL and then 'true'
> 'false' started showing in the DB and cay was happy. Oracle
> doesn't have a BOOL, I think they do have Boolean only accesible
> with PL/SQL, which does not interest me. I will try the CHAR(1) in
> Oracle to see what happens. Do you have a suggestion on this?
> What is a good way to work with booleans in cay? Do I need to
> convert a 't' or 'f' myself into a Boolean or will cay do this for me?
>
> Oracle Cayenne
> NUMBER NUMERIC
> CHAR(1) BOOLEAN
> VARCHAR2 VARCHAR
>
> Thanks,
> Joseph
>
>
This archive was generated by hypermail 2.0.0 : Tue Dec 13 2005 - 11:34:12 EST