Class DatabaseAwareLobType

  • All Implemented Interfaces:
    Serializable, org.hibernate.type.BasicType, org.hibernate.type.ProcedureParameterExtractionAware<String>, org.hibernate.type.ProcedureParameterNamedBinder, org.hibernate.type.SingleColumnType<String>, org.hibernate.type.StringRepresentableType<String>, org.hibernate.type.Type

    public class DatabaseAwareLobType
    extends org.hibernate.type.AbstractSingleColumnStandardBasicType<String>
    A Hibernate @Type used to properly support the CLOB in both Postgres and Oracle. PostgreSQL doesn't have a CLOB type, instead it's a TEXT field. Normally, you'd use org.hibernate.type.TextType to support TEXT, but that won't work for Oracle. https://github.com/hibernate/hibernate-orm/blob/5.6/hibernate-core/src/main/java/org/hibernate/type/TextType.java This Type checks if we are using PostgreSQL. If so, it configures Hibernate to map CLOB to LongVarChar (same as org.hibernate.type.TextType) If not, it uses default CLOB (which works for other databases).
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.hibernate.type.descriptor.sql.SqlTypeDescriptor getDbDescriptor()  
      String getName()  
      • Methods inherited from class org.hibernate.type.AbstractSingleColumnStandardBasicType

        nullSafeSet, sqlType
      • Methods inherited from class org.hibernate.type.AbstractStandardBasicType

        assemble, beforeAssemble, canDoExtraction, canDoSetting, compare, deepCopy, deepCopy, defaultSizes, dictatedSizes, disassemble, extract, extract, fromString, fromStringValue, get, getColumnSpan, getDefaultSize, getDictatedSize, getHashCode, getHashCode, getJavaTypeDescriptor, getMutabilityPlan, getRegistrationKeys, getReplacement, getReturnedClass, getSemiResolvedType, getSqlTypeDescriptor, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, nullSafeSet, nullSafeSet, registerUnderJavaType, remapSqlTypeDescriptor, replace, replace, resolve, semiResolve, set, setJavaTypeDescriptor, setSqlTypeDescriptor, sqlTypes, toColumnNullness, toLoggableString, toString
      • Methods inherited from interface org.hibernate.type.SingleColumnType

        fromStringValue, get, nullSafeGet, set, toString
      • Methods inherited from interface org.hibernate.type.Type

        assemble, beforeAssemble, compare, deepCopy, defaultSizes, dictatedSizes, disassemble, getColumnSpan, getHashCode, getHashCode, getReturnedClass, getSemiResolvedType, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, nullSafeGet, nullSafeGet, nullSafeSet, replace, replace, resolve, resolve, semiResolve, sqlTypes, toColumnNullness, toLoggableString
    • Constructor Detail

      • DatabaseAwareLobType

        public DatabaseAwareLobType()
    • Method Detail

      • getDbDescriptor

        public static org.hibernate.type.descriptor.sql.SqlTypeDescriptor getDbDescriptor()
      • getName

        public String getName()