facebook

Hibernate Rev-Eng different types, same property

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #349594 Reply

    raydawg2000
    Participant

    I have a situation where I want to use JodaTime to handle my Timestamp sql-types. Due to serialization/de-serialization issues I have to map an intermediate class in hibernate to persist the JodaTime object to the database

    http://joda-time.sourceforge.net/contrib/hibernate/userguide.html

    So the issue is that in my rev-eng file I have the declaration of

    <sql-type jdbc-type="TIMESTAMP" hibernate-type="org.joda.time.contrib.hibernate.PersistentDateTime" not-null="true"></sql-type>

    This works as expected in that in creates the correct mapping files and my Pojos have properties of type PersistentDateTIme…the problem is that I want my Pojo properties to have a type of org.joda.time.DateTime. The PersistentDateTime type in itself is useless from a programming standpoint and is only used to persist the DateTime class to the DB.

    So using the Reverse Engineering, how can I declare the Hibernate type of PersistentDateTIme but on the Pojo side have it generate properties of type DateTime?

    Currently I am manually doing a find and replace to make this change, but I would prefer to have it happen automatically.

    #349602 Reply

    raydawg2000,

    We do not support generating different types for POJO and hibernate mapping automatically. You can do it manually only.
    Sorry for the inconvenience caused.

    #349645 Reply

    raydawg2000
    Participant

    *delete this post* I thought i had a solution but turns out it didn’t work

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Hibernate Rev-Eng different types, same property

You must be logged in to post in the forum log in