Module eclipselink
Class FieldDefinition.DatabaseType
- java.lang.Object
-
- org.eclipse.persistence.tools.schemaframework.FieldDefinition.DatabaseType
-
- Enclosing class:
- FieldDefinition
public static final class FieldDefinition.DatabaseType extends Object
PUBLIC: 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
Constructors Constructor Description DatabaseType(String name)DatabaseType(String name, boolean allowSize)DatabaseType(String name, boolean allowSize, boolean allowNull)DatabaseType(String name, boolean allowNull, boolean allowSize, boolean requireSize, int defaultSize, int defaultSubSize, int maxPrecision, int minScale, int maxScale)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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowNull()Return if this type is allowed to be null for this platformbooleanallowSize()Return if this type can support a size specification.intdefaultSize()Return the default size for this type.intdefaultSubSize()Return the default sub-size for this type.booleanequals(Object obj)inthashCode()intmaxPrecision()intmaxScale()intminScale()Stringname()Return the name.booleanrequireSize()Return if this type must have a size specification.StringtoString()
-
-
-
Constructor Detail
-
DatabaseType
public DatabaseType(String name)
-
DatabaseType
public DatabaseType(String name, int defaultSize)
-
DatabaseType
public DatabaseType(String name, int defaultSize, int defaultSubSize)
-
DatabaseType
public DatabaseType(String name, int defaultSize, int defaultSubSize, int maxPrecision, int minScale, int maxScale)
-
DatabaseType
public DatabaseType(String name, boolean allowSize)
-
DatabaseType
public DatabaseType(String name, boolean allowSize, boolean allowNull)
-
DatabaseType
public DatabaseType(String name, boolean allowNull, boolean allowSize, boolean requireSize, int defaultSize, int defaultSubSize, int maxPrecision, int minScale, int maxScale)
-
-
Method Detail
-
name
public String 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()
-
-