Hibernate version:
3.0
Name and version of the database you are using:
MySQL 4.1
Hi,
I am new on Hibernate (even if I read and I have tested for several days) and I need help for a hard part of my project.
I would greatly appreciate If a "hibernate guru" could spend some of his precious time to help me doing the mapping.
Here is a little part of my model. If I could understand how to manage that with hibernate, I think I will then could be autonomous.
A "party" can be either a worker, a client of type organization or a client of type person.
In the case of a worker or a client of type person, the personal data concerning the "party" are stored in the "Person" table.
When I retrieve a worker from the database, I should be able to know his name and if he is enabled or disabled.
When I retrieve a client of type person, I should be able to see his name and an optional comment.
When I retrieve a client of type organization, I should be able to see its name and an optional comment.
In my class model, I would have classes
- Worker
- Client
- ClientOrganization (extending Client)
- ClientPerson (extending Client)
- Party
and the interface Person implemented by Worker and ClientPerson.
I have read a lot of examples about different types of mappings but nothing really close of my need.
For now, I have generated the java classes and mapping files with Hibernate Tools in Eclipse. The result is good and I already can insert and retrieve data but I dont know how I could tune my configuration to make the data and classes model closer.
Thanks a lot for any help or suggestion
Lilian