Got in entity, say X with
@FilterDef(name = "filter", parameters = { @ParamDef(name = "falseVal", type = "integer") })
@Filters({ @Filter(name = "filter", condition = "(:falseVal = rating)") })
I have another entity Y that has a Set of X that is mapped with a
@ManyToMany annotation, a join table is used to the relation.
When i retrieve the entity from a "from X ....." the filter works just fine
But, when i do Y.getX() the collection is initialized without the filter applied !
Any way to apply the filter ?
I've tried setting the filter to the collection mapping but get an SQLException because Hibernate tries to apply the filter to the join table no to the table containing the entity.
|