On Thu, 13 May 2004, Fred McCann wrote:

> OK I think I have something usefule to add. I throw in some debugging
> statements to reflect what OJB was trying to insert and it was flaking out
> on the Date object. Here's what the mapping is for the date field:
> 
>     <field-descriptor
>         name="birthdate"
>         column="birthdate"
>         jdbc-type="DATE"
>     >
>     </field-descriptor>
> 
> 
> This is what an older version of the xdoclet plugin gave me:
> 
> 
>     <field-descriptor
>         name="birthdate"
>         column="birthdate"
>         jdbc-type="TIMESTAMP"
> 
> conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
> ampFieldConversion"
>     >
>     </field-descriptor>

This change was on purpose. However if you try to insert a java.util.Date
object, then you might have to use TIMESTAMP (I'm not sure but it might be
jdbc driver dependent whether one can use java.util.Date) and the
conversion (which you can both specify in the javadoc tags).

BTW, if I run your code snippet through XDoclet, I get the
access='readonly' line (I also added two unit tests for this). Are you
sure you're using the newest XDoclet module (be aware that building OJB
from source does NOT build the XDoclet module as it has different
prerequisites and is rather difficult to build; the CVS version of OJB
does include the newest binary build though).

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to