Fill object data from several tables using hibernate mapping
- by Udo Fholl
Hi all,
I'd like to know if it is possible to fill up a class data from database using the hibernate hbm (mapping).
For instance:
public class someClass {
List<OtherClass> otherClasses;
List<YetAnotherClass> yetAnotherClasses;
//Constructors ?
class OtherClass {
String name;
//setters, getters
}
class YetAnotherClass {
String name;
//setters, getters
}
//setters, getters
}
Using an hbm can I fill in the data from tables OTHER_CLASS_TABLE and YET_ANOTHER_CLASS_TABLE?
I have no such SOME_CLASS_TABLE since this info is for viewing only.
I've been playing with the <join table=""><subselect> and different constructors... But it is not working
Thanks!
Sorry for my english!