Hi Lads,
I've got a question whether is possible to somehow access into inner class property in filter condition. In attached example you can see a class which is annotated by hibernate annotation @filter. I would like to filter those Relation entities whose source's object or target's object is null or equal to zero value. The status property is available via get/set method on AbstractBaseObject class.
If you run the example below an exception called "unknown schema sourceObject" will be thrown.
Code:
@Filters({
@Filter(name = "relation_entitiesSoftDelete", condition = "(sourceObject.status IS NULL OR sourceObject.status=0 OR targetObject.status IS NULL OR targetObject.status=0)")
})
public class Relation {
...
/** Source object. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "source")
@Index(name = "relation_source_fkey")
private AbstractBaseObject sourceObject;
/** Target object. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "target")
@Index(name = "relation_target_fkey")
private AbstractBaseObject targetObject;
...
}
Any help will be much appreciated. Thanks a lot. P.H.