Class RDBMSColumnInfo
java.lang.Object
org.datanucleus.store.rdbms.schema.RDBMSColumnInfo
- All Implemented Interfaces:
org.datanucleus.store.schema.ListStoreSchemaData
,org.datanucleus.store.schema.StoreSchemaData
public class RDBMSColumnInfo
extends Object
implements org.datanucleus.store.schema.ListStoreSchemaData
Representation of column schema information in the datastore.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Indicates the maximum number of bytes in the column (for char types only).protected String
The default value for the column; may be null.protected String
The column name.protected int
The column size.protected short
Indicates the JDBC (SQL) data type fromTypes
.protected int
Indicates the number of fractional digits.private int
Hashcode.protected String
Whether the column definitely doesnt allow NULL values ("NO") or possibly does ("YES").protected int
Indicates whether the column can be NULL.protected int
Indicates the radix, which is typically either 10 or 2.protected int
The index of the column in its table; the first column is 1, the second column is 2.protected String
An explanatory comment on the column; may be null.protected String
The table catalog, which may be null.(package private) RDBMSTableInfo
Parent table schema info.protected String
The table name.protected String
The table schema, which may be null.protected String
The local type name used by the data source. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor to create a column info definition for the current row of the passed ResultSet. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(org.datanucleus.store.schema.StoreSchemaData child) void
addProperty
(String name, Object value) Method to add a property for the column.void
Method to remove all children.final boolean
Indicates whether some object is "equal to" this one.int
org.datanucleus.store.schema.StoreSchemaData
getChild
(int position) List
<org.datanucleus.store.schema.StoreSchemaData> int
short
int
int
int
int
int
org.datanucleus.store.schema.StoreSchemaData
Accessor for the parent Table schema component.getProperty
(String name) Accessor for a property.final int
hashCode()
Returns a hash code value for this object.void
setColumnDef
(String def) void
setColumnSize
(int size) void
setDataType
(short type) void
setDecimalDigits
(int digits) void
setParent
(org.datanucleus.store.schema.StoreSchemaData parent) Mutator for the parent component.toString()
Returns the string representation of this object.
-
Field Details
-
tableCat
The table catalog, which may be null. -
tableSchem
The table schema, which may be null. -
tableName
The table name. -
columnName
The column name. -
dataType
protected short dataTypeIndicates the JDBC (SQL) data type fromTypes
. -
typeName
The local type name used by the data source. -
columnSize
protected int columnSizeThe column size. For char/date types, this is the maximum num of chars, otherwise precision. -
decimalDigits
protected int decimalDigitsIndicates the number of fractional digits. -
numPrecRadix
protected int numPrecRadixIndicates the radix, which is typically either 10 or 2. -
nullable
protected int nullableIndicates whether the column can be NULL. -
remarks
An explanatory comment on the column; may be null. -
columnDef
The default value for the column; may be null. -
charOctetLength
protected int charOctetLengthIndicates the maximum number of bytes in the column (for char types only). -
ordinalPosition
protected int ordinalPositionThe index of the column in its table; the first column is 1, the second column is 2. -
isNullable
Whether the column definitely doesnt allow NULL values ("NO") or possibly does ("YES"). -
hash
private int hashHashcode. Set on first use. -
tableInfo
RDBMSTableInfo tableInfoParent table schema info.
-
-
Constructor Details
-
RDBMSColumnInfo
Constructor to create a column info definition for the current row of the passed ResultSet.- Parameters:
rs
- ResultSet (from DatabaseMetaData.getColumns() for example).- Throws:
org.datanucleus.exceptions.NucleusDataStoreException
- Thrown if an error occurs getting the information
-
-
Method Details
-
setParent
public void setParent(org.datanucleus.store.schema.StoreSchemaData parent) Mutator for the parent component.- Specified by:
setParent
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
- Parameters:
parent
- Parent component
-
getParent
public org.datanucleus.store.schema.StoreSchemaData getParent()Accessor for the parent Table schema component.- Specified by:
getParent
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
- Returns:
- Table schema
-
setDecimalDigits
public void setDecimalDigits(int digits) -
setDataType
public void setDataType(short type) -
setColumnSize
public void setColumnSize(int size) -
setColumnDef
-
getDecimalDigits
public int getDecimalDigits() -
getIsNullable
-
getNullable
public int getNullable() -
getColumnSize
public int getColumnSize() -
getDataType
public short getDataType() -
getNumPrecRadix
public int getNumPrecRadix() -
getCharOctetLength
public int getCharOctetLength() -
getOrdinalPosition
public int getOrdinalPosition() -
getColumnDef
-
getRemarks
-
getTypeName
-
getTableName
-
getColumnName
-
getTableCat
-
getTableSchem
-
addProperty
Method to add a property for the column.- Specified by:
addProperty
in interfaceorg.datanucleus.store.schema.StoreSchemaData
- Parameters:
name
- Name of propertyvalue
- Its value
-
getProperty
Accessor for a property.- Specified by:
getProperty
in interfaceorg.datanucleus.store.schema.StoreSchemaData
- Parameters:
name
- Name of the property- Returns:
- Its value, or null if not defined
-
addChild
public void addChild(org.datanucleus.store.schema.StoreSchemaData child) - Specified by:
addChild
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
clearChildren
public void clearChildren()Method to remove all children.- Specified by:
clearChildren
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getChild
public org.datanucleus.store.schema.StoreSchemaData getChild(int position) - Specified by:
getChild
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getChildren
- Specified by:
getChildren
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getNumberOfChildren
public int getNumberOfChildren()- Specified by:
getNumberOfChildren
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
equals
Indicates whether some object is "equal to" this one. Two RDBMSColumnInfo are considered equal if their catalog, schema, table, and column name are all equal. -
hashCode
public final int hashCode()Returns a hash code value for this object. -
toString
Returns the string representation of this object.
-