use of org.hibernate.usertype.EnhancedUserType in project blaze-persistence by Blazebit.
the class HibernateJpaProvider method supportsEnumLiteral.
@Override
public boolean supportsEnumLiteral(ManagedType<?> ownerType, String attributeName, boolean key) {
if (ownerType instanceof EntityType<?>) {
AbstractEntityPersister entityPersister = getEntityPersister(ownerType);
Type propertyType;
propertyType = getPropertyType(entityPersister, attributeName);
if (propertyType instanceof CollectionType) {
CollectionPersister collectionPersister = entityPersister.getFactory().getCollectionPersister(((CollectionType) propertyType).getRole());
if (key) {
propertyType = collectionPersister.getIndexType();
} else {
propertyType = collectionPersister.getElementType();
}
}
if (propertyType instanceof CustomType) {
return ((CustomType) propertyType).getUserType() instanceof EnhancedUserType;
}
return false;
}
return true;
}
Aggregations