public class SQLTypeInfo extends Object implements org.datanucleus.store.schema.StoreSchemaData
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowsPrecisionSpec
Whether the type allows specification of the precision in parentheses after the type name.
|
protected boolean |
autoIncrement
Whether the type automatically increments for each new row inserted.
|
protected boolean |
caseSensitive
Whether the data type is case-sensitive in comparisons.
|
protected String |
createParams
Indicates the parameters used in defining columns of this type.
|
protected short |
dataType
The JDBC data type number of this data type (see java.sql.Types).
|
protected boolean |
fixedPrecScale
Whether the type can be assigned a fixed scale value, such as for decimal or currency types.
|
protected String |
literalPrefix
The prefix used to quote a literal of this data type; may be null.
|
protected String |
literalSuffix
The suffix used to quote a literal of this data type; may be null.
|
protected String |
localTypeName
Localized version of the DBMS-specific type name of this data type.
|
protected short |
maximumScale
The maximum supported scale value for this data type.
|
protected short |
minimumScale
The minimum supported scale value for this data type.
|
protected int |
nullable
Indicates whether null values are allowed for this data type.
|
protected int |
numPrecRadix
Indicates the numeric radix of this data type, which is usually 2 or 10.
|
protected int |
precision
The maximum precision/length allowed for this data type.
|
protected short |
searchable
The searchability of this data type in terms of the kinds of SQL WHERE clauses that are allowed.
|
protected String |
typeName
The RDBMS-specific name for this data type.
|
protected boolean |
unsignedAttribute
true indicates the type is unsigned, false otherwise.
|
Constructor and Description |
---|
SQLTypeInfo(ResultSet rs)
Constructor to create a type info definition for the current row of the passed ResultSet.
|
SQLTypeInfo(String typeName,
short dataType,
int precision,
String literalPrefix,
String literalSuffix,
String createParams,
int nullable,
boolean caseSensitive,
short searchable,
boolean unsignedAttribute,
boolean fixedPrecScale,
boolean autoIncrement,
String localTypeName,
short minimumScale,
short maximumScale,
int numPrecRadix) |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(String name,
Object value)
Method to add a property for the type.
|
boolean |
equals(Object obj)
Indicates whether some object is "equal to" this one.
|
String |
getCreateParams() |
short |
getDataType() |
String |
getLiteralPrefix() |
String |
getLiteralSuffix() |
String |
getLocalTypeName() |
short |
getMaximumScale() |
short |
getMinimumScale() |
int |
getNullable() |
int |
getNumPrecRadix() |
int |
getPrecision() |
Object |
getProperty(String name)
Accessor for a property.
|
short |
getSearchable() |
String |
getTypeName() |
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isAllowsPrecisionSpec() |
boolean |
isAutoIncrement() |
boolean |
isCaseSensitive() |
boolean |
isCompatibleWith(RDBMSColumnInfo colInfo)
Convenience method for returning if this type is compatible with the provided column.
|
boolean |
isFixedPrecScale() |
boolean |
isUnsignedAttribute() |
void |
setAllowsPrecisionSpec(boolean allowsPrecisionSpec) |
void |
setLocalTypeName(String localTypeName) |
void |
setTypeName(String typeName) |
String |
toString()
Returns the string representation of this object.
|
String |
toString(String indent)
Returns the string representation of this object.
|
protected String typeName
protected short dataType
protected int precision
protected String literalPrefix
protected String literalSuffix
protected String createParams
protected int nullable
protected boolean caseSensitive
protected short searchable
protected boolean unsignedAttribute
protected boolean fixedPrecScale
protected boolean autoIncrement
protected String localTypeName
protected short minimumScale
protected short maximumScale
protected int numPrecRadix
protected boolean allowsPrecisionSpec
public SQLTypeInfo(String typeName, short dataType, int precision, String literalPrefix, String literalSuffix, String createParams, int nullable, boolean caseSensitive, short searchable, boolean unsignedAttribute, boolean fixedPrecScale, boolean autoIncrement, String localTypeName, short minimumScale, short maximumScale, int numPrecRadix)
public SQLTypeInfo(ResultSet rs)
rs
- ResultSet (from DatabaseMetaData.getTypeInfo() for example).org.datanucleus.exceptions.NucleusDataStoreException
- Thrown if an error occurs getting the informationpublic void addProperty(String name, Object value)
addProperty
in interface org.datanucleus.store.schema.StoreSchemaData
name
- Name of propertyvalue
- Its valuepublic Object getProperty(String name)
getProperty
in interface org.datanucleus.store.schema.StoreSchemaData
name
- Name of the propertypublic final boolean equals(Object obj)
public final int hashCode()
public String toString()
public String toString(String indent)
indent
- The indentpublic boolean isCompatibleWith(RDBMSColumnInfo colInfo)
colInfo
- The columnpublic void setTypeName(String typeName)
public String getTypeName()
public short getDataType()
public int getPrecision()
public String getLiteralPrefix()
public String getLiteralSuffix()
public String getCreateParams()
public int getNullable()
public boolean isCaseSensitive()
public short getSearchable()
public boolean isUnsignedAttribute()
public boolean isFixedPrecScale()
public boolean isAutoIncrement()
public void setLocalTypeName(String localTypeName)
public String getLocalTypeName()
public short getMinimumScale()
public short getMaximumScale()
public int getNumPrecRadix()
public void setAllowsPrecisionSpec(boolean allowsPrecisionSpec)
public boolean isAllowsPrecisionSpec()
Copyright © 2020. All rights reserved.