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
Fields Modifier and Type Field Description protected intcharOctetLengthIndicates the maximum number of bytes in the column (for char types only).protected StringcolumnDefThe default value for the column; may be null.protected StringcolumnNameThe column name.protected intcolumnSizeThe column size.protected shortdataTypeIndicates the JDBC (SQL) data type fromTypes.protected intdecimalDigitsIndicates the number of fractional digits.protected StringisNullableWhether the column definitely doesnt allow NULL values ("NO") or possibly does ("YES").protected intnullableIndicates whether the column can be NULL.protected intnumPrecRadixIndicates the radix, which is typically either 10 or 2.protected intordinalPositionThe index of the column in its table; the first column is 1, the second column is 2.protected StringremarksAn explanatory comment on the column; may be null.protected StringtableCatThe table catalog, which may be null.protected StringtableNameThe table name.protected StringtableSchemThe table schema, which may be null.protected StringtypeNameThe local type name used by the data source.
-
Constructor Summary
Constructors Constructor Description RDBMSColumnInfo(ResultSet rs)Constructor to create a column info definition for the current row of the passed ResultSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(org.datanucleus.store.schema.StoreSchemaData child)voidaddProperty(String name, Object value)Method to add a property for the column.voidclearChildren()Method to remove all children.booleanequals(Object obj)Indicates whether some object is "equal to" this one.intgetCharOctetLength()org.datanucleus.store.schema.StoreSchemaDatagetChild(int position)ListgetChildren()StringgetColumnDef()StringgetColumnName()intgetColumnSize()shortgetDataType()intgetDecimalDigits()StringgetIsNullable()intgetNullable()intgetNumberOfChildren()intgetNumPrecRadix()intgetOrdinalPosition()org.datanucleus.store.schema.StoreSchemaDatagetParent()Accessor for the parent Table schema component.ObjectgetProperty(String name)Accessor for a property.StringgetRemarks()StringgetTableCat()StringgetTableName()StringgetTableSchem()StringgetTypeName()inthashCode()Returns a hash code value for this object.voidsetColumnDef(String def)voidsetColumnSize(int size)voidsetDataType(short type)voidsetDecimalDigits(int digits)voidsetParent(org.datanucleus.store.schema.StoreSchemaData parent)Mutator for the parent component.StringtoString()Returns the string representation of this object.
-
-
-
Field Detail
-
tableCat
protected String tableCat
The table catalog, which may be null.
-
tableSchem
protected String tableSchem
The table schema, which may be null.
-
tableName
protected String tableName
The table name.
-
columnName
protected String columnName
The column name.
-
dataType
protected short dataType
Indicates the JDBC (SQL) data type fromTypes.
-
typeName
protected String typeName
The local type name used by the data source.
-
columnSize
protected int columnSize
The column size. For char/date types, this is the maximum num of chars, otherwise precision.
-
decimalDigits
protected int decimalDigits
Indicates the number of fractional digits.
-
numPrecRadix
protected int numPrecRadix
Indicates the radix, which is typically either 10 or 2.
-
nullable
protected int nullable
Indicates whether the column can be NULL.
-
remarks
protected String remarks
An explanatory comment on the column; may be null.
-
columnDef
protected String columnDef
The default value for the column; may be null.
-
charOctetLength
protected int charOctetLength
Indicates the maximum number of bytes in the column (for char types only).
-
ordinalPosition
protected int ordinalPosition
The index of the column in its table; the first column is 1, the second column is 2.
-
isNullable
protected String isNullable
Whether the column definitely doesnt allow NULL values ("NO") or possibly does ("YES").
-
-
Constructor Detail
-
RDBMSColumnInfo
public RDBMSColumnInfo(ResultSet rs)
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 Detail
-
setParent
public void setParent(org.datanucleus.store.schema.StoreSchemaData parent)
Mutator for the parent component.- Specified by:
setParentin 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:
getParentin 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
public void setColumnDef(String def)
-
getDecimalDigits
public int getDecimalDigits()
-
getIsNullable
public String 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
public String getColumnDef()
-
getRemarks
public String getRemarks()
-
getTypeName
public String getTypeName()
-
getTableName
public String getTableName()
-
getColumnName
public String getColumnName()
-
getTableCat
public String getTableCat()
-
getTableSchem
public String getTableSchem()
-
addProperty
public void addProperty(String name, Object value)
Method to add a property for the column.- Specified by:
addPropertyin interfaceorg.datanucleus.store.schema.StoreSchemaData- Parameters:
name- Name of propertyvalue- Its value
-
getProperty
public Object getProperty(String name)
Accessor for a property.- Specified by:
getPropertyin 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:
addChildin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
clearChildren
public void clearChildren()
Method to remove all children.- Specified by:
clearChildrenin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getChild
public org.datanucleus.store.schema.StoreSchemaData getChild(int position)
- Specified by:
getChildin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getChildren
public List getChildren()
- Specified by:
getChildrenin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getNumberOfChildren
public int getNumberOfChildren()
- Specified by:
getNumberOfChildrenin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
equals
public final boolean equals(Object obj)
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.
-
-