Class BooleanJavaType
- java.lang.Object
-
- org.hibernate.type.descriptor.java.AbstractClassJavaType<Boolean>
-
- org.hibernate.type.descriptor.java.BooleanJavaType
-
- All Implemented Interfaces:
Serializable,BasicJavaType<Boolean>,JavaType<Boolean>,PrimitiveJavaType<Boolean>
public class BooleanJavaType extends AbstractClassJavaType<Boolean> implements PrimitiveJavaType<Boolean>
Descriptor forBooleanhandling.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanJavaTypeINSTANCE
-
Constructor Summary
Constructors Constructor Description BooleanJavaType()BooleanJavaType(char characterValueTrue, char characterValueFalse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanfromString(CharSequence string)Class<Boolean[]>getArrayClass()Get the Java type that describes an array of this type.StringgetCheckCondition(String columnName, JdbcType sqlTypeDescriptor, Dialect dialect)The check constraint that should be added to the column definition in generated DDL.longgetDefaultSqlLength(Dialect dialect, JdbcType jdbcType)The default column length when this Java type is mapped to a SQL data type which is parametrized by length, for exampleTypes.VARCHAR.intgetDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType)The default column precision when this Java type is mapped to a SQL data type which is parametrized by precision, for exampleTypes.DECIMAL.intgetDefaultSqlScale(Dialect dialect, JdbcType jdbcType)The default column scale when this Java type is mapped to a SQL data type which is parametrized by scale, for exampleTypes.DECIMAL.BooleangetDefaultValue()Get this Java type's default value.Class<?>getPrimitiveArrayClass()Get the Java type that describes an array of this type's primitive variant.ClassgetPrimitiveClass()Retrieve the primitive counterpart to the wrapper type identified by this descriptorBytetoByte(Boolean value)inttoInt(Boolean value)IntegertoInteger(Boolean value)LongtoLong(Boolean value)ShorttoShort(Boolean value)StringtoString(Boolean value)<X> Xunwrap(Boolean value, Class<X> type, WrapperOptions options)Unwrap an instance of our handled Java type into the requested type.<X> Booleanwrap(X value, WrapperOptions options)Wrap a value as our handled Java type.-
Methods inherited from class org.hibernate.type.descriptor.java.AbstractClassJavaType
areEqual, extractHashCode, extractLoggableRepresentation, getComparator, getJavaType, getJavaTypeClass, getMutabilityPlan, unknownUnwrap, unknownWrap
-
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.descriptor.java.BasicJavaType
getRecommendedJdbcType
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaType
areEqual, coerce, createJavaType, createJavaType, extractHashCode, extractLoggableRepresentation, getComparator, getJavaType, getJavaTypeClass, getLongSqlLength, getMutabilityPlan, getReplacement, isInstance, isWider
-
-
-
-
Field Detail
-
INSTANCE
public static final BooleanJavaType INSTANCE
-
-
Method Detail
-
fromString
public Boolean fromString(CharSequence string)
- Specified by:
fromStringin interfaceBasicJavaType<Boolean>- Specified by:
fromStringin interfaceJavaType<Boolean>
-
unwrap
public <X> X unwrap(Boolean value, Class<X> type, WrapperOptions options)
Description copied from interface:JavaTypeUnwrap an instance of our handled Java type into the requested type. As an example, if this is aJavaType<Integer>and we are asked to unwrap theInteger valueas aLongwe would return something likeLong.valueOf( value.longValue() ). Intended use is duringPreparedStatementbinding.
-
wrap
public <X> Boolean wrap(X value, WrapperOptions options)
Description copied from interface:JavaTypeWrap a value as our handled Java type. Intended use is duringResultSetextraction.
-
toInt
public int toInt(Boolean value)
-
getPrimitiveClass
public Class getPrimitiveClass()
Description copied from interface:PrimitiveJavaTypeRetrieve the primitive counterpart to the wrapper type identified by this descriptor- Specified by:
getPrimitiveClassin interfacePrimitiveJavaType<Boolean>- Returns:
- The primitive Java type.
-
getArrayClass
public Class<Boolean[]> getArrayClass()
Description copied from interface:PrimitiveJavaTypeGet the Java type that describes an array of this type.- Specified by:
getArrayClassin interfacePrimitiveJavaType<Boolean>
-
getPrimitiveArrayClass
public Class<?> getPrimitiveArrayClass()
Description copied from interface:PrimitiveJavaTypeGet the Java type that describes an array of this type's primitive variant.- Specified by:
getPrimitiveArrayClassin interfacePrimitiveJavaType<Boolean>
-
getDefaultValue
public Boolean getDefaultValue()
Description copied from interface:JavaTypeGet this Java type's default value.- Specified by:
getDefaultValuein interfaceJavaType<Boolean>- Returns:
- The default value.
-
getDefaultSqlLength
public long getDefaultSqlLength(Dialect dialect, JdbcType jdbcType)
Description copied from interface:JavaTypeThe default column length when this Java type is mapped to a SQL data type which is parametrized by length, for exampleTypes.VARCHAR.- Specified by:
getDefaultSqlLengthin interfaceJavaType<Boolean>- Returns:
Size.DEFAULT_LENGTHunless overridden
-
getDefaultSqlPrecision
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType)
Description copied from interface:JavaTypeThe default column precision when this Java type is mapped to a SQL data type which is parametrized by precision, for exampleTypes.DECIMAL.- Specified by:
getDefaultSqlPrecisionin interfaceJavaType<Boolean>- Returns:
Size.DEFAULT_PRECISIONunless overridden
-
getDefaultSqlScale
public int getDefaultSqlScale(Dialect dialect, JdbcType jdbcType)
Description copied from interface:JavaTypeThe default column scale when this Java type is mapped to a SQL data type which is parametrized by scale, for exampleTypes.DECIMAL.- Specified by:
getDefaultSqlScalein interfaceJavaType<Boolean>- Returns:
Size.DEFAULT_SCALEunless overridden
-
getCheckCondition
public String getCheckCondition(String columnName, JdbcType sqlTypeDescriptor, Dialect dialect)
Description copied from interface:JavaTypeThe check constraint that should be added to the column definition in generated DDL.- Specified by:
getCheckConditionin interfaceJavaType<Boolean>- Parameters:
columnName- the name of the columnsqlTypeDescriptor- theJdbcTypeof the mapped columndialect- the SQLDialect- Returns:
- a check constraint condition or null
-
-