You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ListArrayType is a grant child of AbstractStandardBasicType which sets isCollectionType to false.
The impact is
When using CriteriaBuilder with the field it checks if attributeMetadata.isPlural() by reading isCollectionType.
The field should be ListAttribute but since it is not a collection type it was builded as a SingularAttribute.
And calling CriteriaBuilder.isMember() throws unknown collection expression type [org.hibernate.query.criteria.internal.path.SingularAttributePath]
Code example:
A Entity
@TypeDef(name = "list-array", typeClass = ListArrayType.class)
public class AEntity implements Serializable {
ID and other fields..
@Type(type = "list-array")
@Column(name = "version", columnDefinition = "integer[]", nullable = false)
private List<Integer> version;
}
Queries
final CriteriaBuilder cb = entityManager.getCriteriaBuilder();
final CriteriaQuery<AEntity> cq = cb.createQuery(AEntity.class);
final Root<AEntity> root = cq.from(AEntity.class);
cq.select(root).where(cb.isMember(filter.getVersion(0), root.get("version")));
entityManager.createQuery(cq).getResultList();
The text was updated successfully, but these errors were encountered:
ListArrayType
is a grant child ofAbstractStandardBasicType
which setsisCollectionType
tofalse
.The impact is
When using CriteriaBuilder with the field it checks if
attributeMetadata.isPlural()
by readingisCollectionType
.The field should be
ListAttribute
but since it is not a collection type it was builded as aSingularAttribute
.And calling CriteriaBuilder.isMember() throws
unknown collection expression type [org.hibernate.query.criteria.internal.path.SingularAttributePath]
Code example:
A Entity
Queries
The text was updated successfully, but these errors were encountered: