Search in sources :

Example 1 with MaterializedNClobType

use of org.hibernate.type.MaterializedNClobType in project hibernate-orm by hibernate.

the class ValidityAuditStrategy method isNonIdentifierWhereConditionsRequired.

private boolean isNonIdentifierWhereConditionsRequired(String entityName, String propertyName, SessionImplementor session) {
    final Type propertyType = session.getSessionFactory().getMetamodel().entityPersister(entityName).getPropertyType(propertyName);
    if (propertyType.isCollectionType()) {
        final CollectionType collectionType = (CollectionType) propertyType;
        final Type collectionElementType = collectionType.getElementType(session.getSessionFactory());
        if (collectionElementType instanceof ComponentType) {
            // required for Embeddables
            return true;
        } else if (collectionElementType instanceof MaterializedClobType || collectionElementType instanceof MaterializedNClobType) {
            // for Map<> using @Lob annotations
            return collectionType instanceof MapType;
        }
    }
    return false;
}
Also used : CollectionType(org.hibernate.type.CollectionType) ComponentType(org.hibernate.type.ComponentType) MaterializedNClobType(org.hibernate.type.MaterializedNClobType) MaterializedClobType(org.hibernate.type.MaterializedClobType) MapType(org.hibernate.type.MapType) RevisionType(org.hibernate.envers.RevisionType) Type(org.hibernate.type.Type) ComponentType(org.hibernate.type.ComponentType) CollectionType(org.hibernate.type.CollectionType) MaterializedNClobType(org.hibernate.type.MaterializedNClobType) MaterializedClobType(org.hibernate.type.MaterializedClobType) MapType(org.hibernate.type.MapType)

Aggregations

RevisionType (org.hibernate.envers.RevisionType)1 CollectionType (org.hibernate.type.CollectionType)1 ComponentType (org.hibernate.type.ComponentType)1 MapType (org.hibernate.type.MapType)1 MaterializedClobType (org.hibernate.type.MaterializedClobType)1 MaterializedNClobType (org.hibernate.type.MaterializedNClobType)1 Type (org.hibernate.type.Type)1