Okay, suppose I have a simple POJO class like this:
Code:
@Entitiy
@Table(name="T_ORGANIZATION")
public class Organization {
private int organizationId;
private Collection childOrganizations;
@Id
@GeneratedValue
@Column(name="organization_id")
public int getOrganizationId() {
return this.organizationId;
}
public void setOrganizationId(int id) {
this.organizationId = id;
}
// Assume this is mapped correctly
public Collection getChildOrganizations() {
return this.childOrganizations;
}
public void setChildOrganizations(Collection children) {
this.childOrganizations=children;
}
// Assume equals() and hashCode() are overriden here
}
What would be a good HQL query to pull all of the child organizations (and their child organizations, etc) into a single collection?
Jason