Fill object data from several tables using hibernate mapping

Posted by Udo Fholl on Stack Overflow See other posts from Stack Overflow or by Udo Fholl
Published on 2010-05-19T10:46:45Z Indexed on 2010/05/19 10:50 UTC
Read the original article Hit count: 301

Filed under:
|

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!

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about mapping