Hi,
I’m trying to implement multi-tenant logic using accessConstraints based on createdBy attribute and session$userLogin, as such:
@JpqlConstraint(target = MyEntity.class, where = "{E}.createdBy = session$userLogin")
@Override
public ConstraintsContainer accessConstraints() {
return super.accessConstraints();
}
I got this error at runtime:
Exception Description: Problem compiling [select e from app_MyEntity e where e.createdBy = session$userLogin].
[38, 49] The basic mapping 'e.createdBy' cannot be used in conjunction with the = operator.
[52, 69] The identification variable 'session$userLogin' is not defined in the FROM clause.
Can’t see what’s wrong, or if this use case is not supported