-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Customizing reverse engineering
PostPosted: Wed Jul 13, 2011 7:54 am 
Newbie

Joined: Wed Jul 13, 2011 6:55 am
Posts: 4
Hi!

I have some questions about customizing the reverse engineering of Hibernate Tools and the r. e. in general.

1)

I need to map a pretty big database (DB2) to (Hibernate / JPA) POJOs. Unfortunately there are a lot of tables which contain foreign keys associated to the same table and having the same names. So a short example:

-------------------
| MAIN
-------------------
| pk PNR
| ...
-------------------

-------------------
| T1
-------------------
| pk LNR
| fk PNR
-------------------


-------------------
| T2
-------------------
| pk KNR
| fk PNR
-------------------


Due to this structure, I get the "foreign key mapped to different tables" error, but I'm not able to change the db structure in any way. Does this mean I cannot use the reverse engineering of Hibernate Tools?


2)

I want the @Column annotation to be at the private fields instead of annotations at the getter / setter methods. The only way to achieve this is by custom templates, is that right?


3)

The tables contain columns with DB2 Type 'DATE' as well as columns with type "TIMESTAMP". Hibernate Tools always map them as java.util.Date without annotations. Hibernate therefore doesn't know what db type the properties have and uses TIMESTAMP as default. The solution for this is to add the @Temporal annotation. Is there a way to do this automatically with HT?





Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.