We have a Hibernate based system with Annotations.
Our entities have a custom property DELETED. We have to select non deleted entities with non deleted sub-entities. How can we can do it?
Little sample for describe the situation:
GenericEntity {
...
@Basic
@Column(name = DELETED)
protected Boolean deleted = false;
@ManyToOne
@JoinColumn(name = LOCATION, nullable = false)
protected Location location;
}
Location extends GenericEntity entity, and also has a DELETED property.
How can we select some not deleted GenericEntities with non deleted Locations?