Package net.java.ao.types
Class TypeInfo<T>
java.lang.Object
net.java.ao.types.TypeInfo<T>
Describes a mapping between a
LogicalType, with optional qualifiers, and the
underlying database type.
The database provider constructs one instance of this class for each supported logical type, and may provide additional derived instances for specific entity properties. The caller will never construct an instance of this class directly.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionTypeInfo(LogicalType<T> logicalType, SchemaProperties schemaProperties, TypeQualifiers defaultQualifiers) protectedTypeInfo(LogicalType<T> logicalType, SchemaProperties schemaProperties, TypeQualifiers defaultQualifiers, TypeQualifiers qualifiers) -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsQualifiers(TypeQualifiers qualifiers) Returns true if this type is compatible with the given qualifiers.booleanintReturns the JDBC type code to use when passing values to the database.Returns theLogicalTypedescribing what Java types are supported by this type and how they are mapped to JDBC operations.Returns theTypeQualifiersdescribing optional length/precision modifiers for this type, which may include defaults set by the database provider and/or values specified by annotations for particular entity properties.Returns theSchemaPropertiesdescribing the SQL representation of this type, as specified by the database provider.Returns the SQL type identifier for this type, including any length or precision modifiers.inthashCode()booleanReturns a boolean specifying if this type can be used as a primary key value.toString()Describes the type mapping in a format that includes the logical type name, any non-default qualifiers, and the SQL type name, e.g.withQualifiers(TypeQualifiers qualifiers) Returns a new instance of this class with the same properties, but with the defaultTypeQualifiersoverridden by the specified values.
-
Constructor Details
-
TypeInfo
public TypeInfo(LogicalType<T> logicalType, SchemaProperties schemaProperties, TypeQualifiers defaultQualifiers) -
TypeInfo
protected TypeInfo(LogicalType<T> logicalType, SchemaProperties schemaProperties, TypeQualifiers defaultQualifiers, TypeQualifiers qualifiers)
-
-
Method Details
-
getLogicalType
Returns theLogicalTypedescribing what Java types are supported by this type and how they are mapped to JDBC operations. -
getSchemaProperties
Returns theSchemaPropertiesdescribing the SQL representation of this type, as specified by the database provider. -
getQualifiers
Returns theTypeQualifiersdescribing optional length/precision modifiers for this type, which may include defaults set by the database provider and/or values specified by annotations for particular entity properties. -
isAllowedAsPrimaryKey
public boolean isAllowedAsPrimaryKey()Returns a boolean specifying if this type can be used as a primary key value.- Returns:
- if it's allowed or not
-
getSqlTypeIdentifier
Returns the SQL type identifier for this type, including any length or precision modifiers. -
getJdbcWriteType
public int getJdbcWriteType()Returns the JDBC type code to use when passing values to the database. This is based on the default value from theLogicalTypebut can be overridden by each database provider in theSchemaProperties. -
withQualifiers
Returns a new instance of this class with the same properties, but with the defaultTypeQualifiersoverridden by the specified values.- Throws:
ActiveObjectsConfigurationException- if the qualifiers are not allowed for this type
-
acceptsQualifiers
Returns true if this type is compatible with the given qualifiers. -
equals
-
hashCode
public int hashCode() -
toString
Describes the type mapping in a format that includes the logical type name, any non-default qualifiers, and the SQL type name, e.g. "String(255):VARCHAR".
-