This is driving me crazy -- I'm pretty sure that Hibernate can determine mapping relationships between tables and thus reflect this in the POJO's generated.
Except it's not.
I am using MySQL with STS & Hibernate Tools 4.0.0 and I have a one-to-many and a one-to-one table relationship, between Person <--> Phone and Phone <--> PhoneType and I am able to generate using the 'Hibernate Code Generation Configuration' the 'Domain Code' and the 'DAO Code', however neither of the files have any mappings between the tables.
Now here is a possible issue:
In order to get any annotations at all, I have switched on the option 'Generate EJB3 annotations'. Now I am using plain old Hibernate here, and not JPA.
So my questions are:
- Can Hibernate Tools generate Annotations for plain old Hibernate?
- Can it generate mapping information in the POJO's (i.e. @manytomany / @manytoone) ?
Thanks a lot for your help,
Bob