Fix RSQL G2 visitor and referenes (e.g. assignedds) with multiple conditions (#2405)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-05-16 14:06:30 +03:00
committed by GitHub
parent 05bcebc0f9
commit 86fca64e51
2 changed files with 12 additions and 5 deletions

View File

@@ -296,8 +296,9 @@ public class JpaQueryRsqlVisitorG2<A extends Enum<A> & RsqlQueryField, T>
// see org.eclipse.persistence.internal.jpa.querydef.FromImpl implementation for more details when root.get creates a join
final Attribute<?, ?> attribute = root.getModel().getAttribute(fieldNameSplit);
if (!attribute.isCollection()) {
// it is a SingularAttribute and not join if it is of basic persistent type
if (((SingularAttribute<?, ?>) attribute).getType().getPersistenceType().equals(Type.PersistenceType.BASIC)) {
// it is a SingularAttribute and not join if it is of basic or entity persistence type
final Type.PersistenceType persistenceType = ((SingularAttribute<?, ?>) attribute).getType().getPersistenceType();
if (persistenceType.equals(Type.PersistenceType.BASIC) || persistenceType.equals(Type.PersistenceType.ENTITY)) {
return root.get(fieldNameSplit);
}
} // if a collection - it is a join