Assume
@Entity
Class Animals { }
@Entity
@Inheritance( stragegy = InheritanceType.JOINED)
class Dogs extends Animals {
private String furType;
}
@Entity
@Inheritance( stragegy = InheritanceType.JOINED)
class Cat extends Animals {
private String furType;
}
All entities are real classes in my database and I don t have the option of redesigning our database.
How can I used a DetactedCriteria to create a disjunction query that says give me all "Animals" where furType= loud for dogs OR furType= soft for cats? Sorry I didn t design the class hierarchy so I m not responsible for the fact that the property names are the same and I can t redesign it because there are other subclasses who s tables don t contain "furType".