Class OBYesNoType

  • All Implemented Interfaces:
    Serializable, org.hibernate.type.BasicType, org.hibernate.type.DiscriminatorType<Boolean>, org.hibernate.type.IdentifierType<Boolean>, org.hibernate.type.LiteralType<Boolean>, org.hibernate.type.PrimitiveType<Boolean>, org.hibernate.type.ProcedureParameterExtractionAware<Boolean>, org.hibernate.type.ProcedureParameterNamedBinder, org.hibernate.type.SingleColumnType<Boolean>, org.hibernate.type.StringRepresentableType<Boolean>, org.hibernate.type.Type

    public class OBYesNoType
    extends org.hibernate.type.AbstractSingleColumnStandardBasicType<Boolean>
    implements org.hibernate.type.PrimitiveType<Boolean>, org.hibernate.type.DiscriminatorType<Boolean>
    Implements the same logic as the hibernate yesno type, handles null values as false. As certain methods can not be extended the solution is to catch the isDirty check by reimplementing the areEqual method.
    Author:
    mtaal
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      OBYesNoType()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Serializable getDefaultValue()  
      String getName()  
      Class getPrimitiveClass()  
      String objectToSQLString​(Boolean value, org.hibernate.dialect.Dialect dialect)  
      Boolean stringToObject​(String xml)  
      • 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.PrimitiveType

        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, nullSafeSet, replace, replace, resolve, resolve, semiResolve, sqlTypes, toColumnNullness, toLoggableString
    • Constructor Detail

      • OBYesNoType

        public OBYesNoType()
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface org.hibernate.type.Type
      • getPrimitiveClass

        public Class getPrimitiveClass()
        Specified by:
        getPrimitiveClass in interface org.hibernate.type.PrimitiveType<Boolean>
      • getDefaultValue

        public Serializable getDefaultValue()
        Specified by:
        getDefaultValue in interface org.hibernate.type.PrimitiveType<Boolean>
      • objectToSQLString

        public String objectToSQLString​(Boolean value,
                                        org.hibernate.dialect.Dialect dialect)
                                 throws Exception
        Specified by:
        objectToSQLString in interface org.hibernate.type.LiteralType<Boolean>
        Throws:
        Exception