public class FieldTypeDefinition
extends java.lang.Object
implements java.io.Serializable
Responsibilities:
Constructor and Description |
---|
FieldTypeDefinition() |
FieldTypeDefinition(java.lang.String databaseTypeName)
Return a new field type.
|
FieldTypeDefinition(java.lang.String databaseTypeName,
boolean allowsSize)
Return a new field type with a required size defaulting to the defaultSize.
|
FieldTypeDefinition(java.lang.String databaseTypeName,
boolean allowsSize,
boolean allowsNull)
Return a new field type with a required size defaulting to the defaultSize and
shouldAllowNull set to allowsNull.
|
FieldTypeDefinition(java.lang.String databaseTypeName,
int defaultSize)
Return a new field type with a required size defaulting to the defaultSize.
|
FieldTypeDefinition(java.lang.String databaseTypeName,
int defaultSize,
int defaultSubSize)
Return a new field type with a required size defaulting to the defaultSize.
|
FieldTypeDefinition(java.lang.String databaseTypeName,
int defaultSize,
java.lang.String aTypesuffix) |
Modifier and Type | Method and Description |
---|---|
int |
getDefaultSize()
Return the default size for this type.
|
int |
getDefaultSubSize()
Return the default sub-size for this type.
|
int |
getMaxPrecision() |
int |
getMaxScale() |
int |
getMinScale() |
java.lang.String |
getName()
Return the name.
|
java.lang.String |
getTypesuffix()
Returns a type suffix (like unicode, byte or ascii) for maxdb create table stmts
|
boolean |
isSizeAllowed()
Return if this type can support a size specification.
|
boolean |
isSizeRequired()
Return if this type must have a size specification.
|
void |
setDefaultSize(int defaultSize)
Set the default size for this type.
|
void |
setDefaultSubSize(int defaultSubSize)
Set the default sub-size for this type.
|
void |
setIsSizeAllowed(boolean aBoolean)
Set if this type can support a size specification.
|
void |
setIsSizeRequired(boolean aBoolean)
Set if this type must have a size specification.
|
FieldTypeDefinition |
setLimits(int maxPrecision,
int minScale,
int maxScale)
Set the maximum precision and the minimum and maximum scale.
|
void |
setMaxPrecision(int maximum) |
void |
setMaxScale(int maximum) |
void |
setMinScale(int minimum) |
void |
setName(java.lang.String name)
Set the name.
|
void |
setShouldAllowNull(boolean allowsNull)
Set if this type is allowed to be null for this platform
|
void |
setSizeDisallowed()
Set this type to not allow a size specification.
|
void |
setSizeOptional()
Set this type to optionally have a size specification.
|
void |
setSizeRequired()
Set this type to require to have a size specification.
|
boolean |
shouldAllowNull()
Return if this type is allowed to be null for this platform
|
java.lang.String |
toString() |
public FieldTypeDefinition()
public FieldTypeDefinition(java.lang.String databaseTypeName)
#setName()
public FieldTypeDefinition(java.lang.String databaseTypeName, int defaultSize)
public FieldTypeDefinition(java.lang.String databaseTypeName, int defaultSize, int defaultSubSize)
public FieldTypeDefinition(java.lang.String databaseTypeName, int defaultSize, java.lang.String aTypesuffix)
public FieldTypeDefinition(java.lang.String databaseTypeName, boolean allowsSize)
public FieldTypeDefinition(java.lang.String databaseTypeName, boolean allowsSize, boolean allowsNull)
public int getDefaultSize()
public int getDefaultSubSize()
public int getMaxPrecision()
public int getMaxScale()
public int getMinScale()
public java.lang.String getName()
name
- can be any database primitive type name,
this name will then be mapped to the Java primitive type,
the datbase type varies by platform and the mappings can be found in the subclasses of DatabasePlatform.
these Java names and their ODBC mappings include;
- 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_TIMESTAMPDatabasePlatform
public java.lang.String getTypesuffix()
public boolean isSizeAllowed()
public boolean isSizeRequired()
public boolean shouldAllowNull()
public void setDefaultSize(int defaultSize)
public void setDefaultSubSize(int defaultSubSize)
public void setIsSizeAllowed(boolean aBoolean)
public void setIsSizeRequired(boolean aBoolean)
public void setShouldAllowNull(boolean allowsNull)
public FieldTypeDefinition setLimits(int maxPrecision, int minScale, int maxScale)
public void setMaxPrecision(int maximum)
public void setMaxScale(int maximum)
public void setMinScale(int minimum)
public void setName(java.lang.String name)
name
- can be any database primitive type name,
this name will then be mapped to the Java primitive type,
the datbase type varies by platform and the mappings can be found in the subclasses of DatabasePlatform.
these Java names and their ODBC mappings include;
- 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_TIMESTAMPDatabasePlatform
public void setSizeDisallowed()
public void setSizeOptional()
public void setSizeRequired()
public java.lang.String toString()
toString
in class java.lang.Object
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference