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!
|