Module eclipselink
Class FieldDefinition.DatabaseType
java.lang.Object
org.eclipse.persistence.tools.schemaframework.FieldDefinition.DatabaseType
- Enclosing class:
FieldDefinition
Purpose: Define a database-platform-specific definition for a platform independent Java class type.
This is used for the field creation within a table creation statement.
Responsibilities:
- Store a default size and know if the size option is required or optional.
- Store the name of the real database type.
- Maintain maximum precision and optional min & max Scale.
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseType(String name) DatabaseType(String name, boolean allowSize) DatabaseType(String name, boolean allowSize, boolean allowNull) DatabaseType(String name, int defaultSize) DatabaseType(String name, int defaultSize, int defaultSubSize) DatabaseType(String name, int defaultSize, int defaultSubSize, int maxPrecision, int minScale, int maxScale) DatabaseType(String name, int defaultSize, String suffix) DatabaseType(String name, String suffix, boolean allowNull, boolean allowSize, boolean requireSize, int defaultSize, int defaultSubSize, int maxPrecision, int minScale, int maxScale) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn if this type is allowed to be null for this platformbooleanReturn if this type can support a size specification.intReturn the default size for this type.intReturn the default sub-size for this type.booleaninthashCode()intintmaxScale()intminScale()name()Return the name.ofNoSize()ofSize(int size) booleanReturn if this type must have a size specification.suffix()toString()
-
Constructor Details
-
DatabaseType
-
DatabaseType
-
DatabaseType
-
DatabaseType
-
DatabaseType
public DatabaseType(String name, int defaultSize, int defaultSubSize, int maxPrecision, int minScale, int maxScale) -
DatabaseType
-
DatabaseType
-
DatabaseType
-
-
Method Details
-
ofSize
-
ofNoSize
-
name
Return the name. Can be any database primitive type name, this name will then be mapped to the Java primitive type, the database type varies by platform, and the mappings can be found in the subclasses of DDLPlatform.Java names and their ODBC mappings include Java name ODBC mapping Integer SQL_INT Float SQL_FLOAT Double SQL_DOUBLE Long SQL_LONG Short SQL_INT BigDecimal SQL_NUMERIC BigInteger SQL_NUMERIC String SQL_VARCHAR Array BLOB Character[] SQL_CHAR Boolean SQL_BOOL Text CLOB Date SQL_DATE Time SQL_TIME Timestamp SQL_TIMESTAMP -
allowNull
public boolean allowNull()Return if this type is allowed to be null for this platform -
allowSize
public boolean allowSize()Return if this type can support a size specification. -
requireSize
public boolean requireSize()Return if this type must have a size specification. -
defaultSize
public int defaultSize()Return the default size for this type. This default size will be used if the database requires specification of a size, and the table definition did not provide one. -
defaultSubSize
public int defaultSubSize()Return the default sub-size for this type. This default size will be used if the database requires specification of a size, and the table definition did not provide one. -
maxPrecision
public int maxPrecision() -
maxScale
public int maxScale() -
minScale
public int minScale() -
suffix
-
equals
-
hashCode
public int hashCode() -
toString
-