posted 12 years ago
Hi
An entity X has a list of entity Y and the entity Y has an instance of entity Z.
The relation between X to Y is OneToMany and the relation between Y to Z is ManyToOne.
I want to retrieve X and have all the associated entities retrieved with them as well.
What HQL query do I write so that I get the whole chain retrieved all at once.
or What annonations do I use for it? At present its hibernateTemplate.find("from X").
X=ServiceProvider, Y=BusinessLocations.java, Z=State.java
I have the entities annotated below and I am having the whole chain persisted into database but when i try to retrieve the list of Y(BusinessLocation), I get nothing.
What do I do join X with Y and Y with Z?
Below are the entities x, Y and Z.
ServiceProvider.java
BusinessLocation.java
State.java
Could someone help me out here?
Thanks