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!
So you have a class which seems not to be a real entity, since it does not have identity to start with, right? Then I woulf guess you can’t map it directly.
Depending on how do you actually use
someClass, I can think of the following workarounds:component– but then again, you could simply map the contained lists directly in this case