| Author |
Hibernate and class association
|
ben oliver
Ranch Hand
Joined: Mar 28, 2006
Posts: 369
|
|
My current Traveling agent application system includes lot of class associations like class Tour { Flight f; int i; double d; .... } class Flight { Log l; int i; double d; .... } class Log { Date departure ; Date arrival ; .... } The application and database start from scratch. 1. can we use hibernate to handle such complex chained object relation ? Can we easily get "Tour" information and grab all of the "Flight" and "Log" information associated with the "Tour" ? 2. should the tables be created in the same or different format from the above class struture ? which will be better ?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
1. can we use hibernate to handle such complex chained object relation ? Can we easily get "Tour" information and grab all of the "Flight" and "Log" information associated with the "Tour" ?
Yes.
2. should the tables be created in the same or different format from the above class struture ? which will be better ?
There is not really enough information here to say conclusively (Must tours have a Flight? Can they have more than one Flight? Can a Log exist independent of a Flight? etc.) but assuming the association is one to many for Tour to Flight and Flight to Log then it looks OK.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
 |
|
|
subject: Hibernate and class association
|
|
|