Hi guys,
Hibernate newbie here.
I have class University with one to many relationship with class Student. Class Student has many to one with University. I'd like Student to have a many to one rel with a subset of class University's fields, not all of them. For example I'd like Student to have a University reference which contains only the id and the name of the University. For that I was thinking of creating first a BasicUniversity which contains the id and name and this class would be used in Student for the many to one rel. Then University would extend BasicUniversity and add other fields.
Do you consider this a good approach? Do you have other suggestions?
Thanks, Cristian
|