Class NotLoggablePrimitiveByteArrayBlobType

java.lang.Object
org.hibernate.type.AbstractStandardBasicType<T>
org.hibernate.type.AbstractSingleColumnStandardBasicType<byte[]>
org.hibernate.type.MaterializedBlobType
com.tridion.storage.hibernatetype.NotLoggablePrimitiveByteArrayBlobType
All Implemented Interfaces:
Serializable, org.hibernate.type.BasicType, org.hibernate.type.ProcedureParameterExtractionAware<byte[]>, org.hibernate.type.ProcedureParameterNamedBinder, org.hibernate.type.SingleColumnType<byte[]>, org.hibernate.type.StringRepresentableType<byte[]>, org.hibernate.type.Type

public class NotLoggablePrimitiveByteArrayBlobType extends org.hibernate.type.MaterializedBlobType
Hibernate type to map a byte[] to a Blob. The only purpose of this special hibernate type is to override the toLoggableString() method implemented in ByteArrayBlobType. The implementation in ByteArrayBlobType causes a normal byte array to be transformed into a string by taking each byte in it and calling Integer.toHexString() on it. This causes the creation in memory of a string of twice the size of the byte array. This causes in the end, when having debug enabled, very slow deployment. In our implementation.
See Also:
  • Field Summary

    Fields inherited from class org.hibernate.type.MaterializedBlobType

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    toString(byte[] value)
    Override this method so that we do just a simple logging of a byte array: we just return "(not printed)" as it's string representation.

    Methods inherited from class org.hibernate.type.MaterializedBlobType

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.hibernate.type.SingleColumnType

    fromStringValue, get, nullSafeGet, set

    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 Details

    • NotLoggablePrimitiveByteArrayBlobType

      public NotLoggablePrimitiveByteArrayBlobType()
  • Method Details

    • toString

      public String toString(byte[] value)
      Override this method so that we do just a simple logging of a byte array: we just return "(not printed)" as it's string representation.
      Specified by:
      toString in interface org.hibernate.type.SingleColumnType<byte[]>
      Specified by:
      toString in interface org.hibernate.type.StringRepresentableType<byte[]>
      Overrides:
      toString in class org.hibernate.type.AbstractStandardBasicType<byte[]>