JBoss Community

Jodatime and hibernate pojo generator

created by Guillermo L in JBoss Tools - View the full discussion

Hi,

I want to use jodatime for date types and hibernate tools to get the generated pojos from database.

 

I'm using jadira in order to make this possible, however even when I map the type as the following I do not get the expected @Type annotation as I guess it should be.

 

My hibernate reveng file is as the following:

 

<type-mapping>

    <sql-type jdbc-type="TIMESTAMP" hibernate-type="org.jadira.usertype.dateandtime.joda.PersistentDateTime">

</type-mapping>

 

and here's the produced code:

 

    @Column(name = "adate", length = 23)

    private DateTime adate;

 

As per what I read about using jadira with hibernate I was expecting to get something like the following:

 

    @Column(name = "adate", length = 23)

    @Type(type="org.jadira.usertype.dateandtime.joda.PersistentDateTime")

    private DateTime adate;

 

Hints are more than welcome :-)

Reply to this message by going to Community

Start a new discussion in JBoss Tools at Community