I have the following base class
Code:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@FilterDef(name = "visibilityFilter", defaultCondition = "visible = :visible", parameters = @ParamDef(name = "visible", type = "java.lang.Boolean"))
@Filter(name = "visibilityFilter")
public class ClassA {
...
private boolean visible = true;
...
public void setVisible(boolean visible) {
this.visible = visible
}
public boolean isVisible() {
return visible;
}
}
And the following subclass:
Code:
public class SubclassA extends ClassA {
...
}
Then in ClassB I have:
Code:
public class ClassB {
...
@OneToMany(cascade = { ALL }, fetch = LAZY)
@JoinColumn(name = "classb_id")
@Filter(name = "visibilityFilter")
private List<SubclassA> list = new ArrayList<SubclassA>();
...
}
Simply I need to use the filter called "visibilityFilter" to filter the collection in ClassB
The above code produced the following error :
Code:
WARN o.h.util.JDBCExceptionReporter - SQL Error: 1054, SQLState: 42S22
ERROR o.h.util.JDBCExceptionReporter - Unknown column 'list0_.visible' in 'where clause'