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 java.lang.Object implements org.datanucleus.store.schema.ListStoreSchemaData
Representation of column schema information in the datastore.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
charOctetLength
Indicates the maximum number of bytes in the column (for char types only).protected java.lang.String
columnDef
The default value for the column; may be null.protected java.lang.String
columnName
The column name.protected int
columnSize
The column size.protected short
dataType
Indicates the JDBC (SQL) data type fromTypes
.protected int
decimalDigits
Indicates the number of fractional digits.private int
hash
Hashcode.protected java.lang.String
isNullable
Whether the column definitely doesnt allow NULL values ("NO") or possibly does ("YES").protected int
nullable
Indicates whether the column can be NULL.protected int
numPrecRadix
Indicates the radix, which is typically either 10 or 2.protected int
ordinalPosition
The index of the column in its table; the first column is 1, the second column is 2.protected java.lang.String
remarks
An explanatory comment on the column; may be null.protected java.lang.String
tableCat
The table catalog, which may be null.(package private) RDBMSTableInfo
tableInfo
Parent table schema info.protected java.lang.String
tableName
The table name.protected java.lang.String
tableSchem
The table schema, which may be null.protected java.lang.String
typeName
The local type name used by the data source.
-
Constructor Summary
Constructors Constructor Description RDBMSColumnInfo(java.sql.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 void
addChild(org.datanucleus.store.schema.StoreSchemaData child)
void
addProperty(java.lang.String name, java.lang.Object value)
Method to add a property for the column.void
clearChildren()
Method to remove all children.boolean
equals(java.lang.Object obj)
Indicates whether some object is "equal to" this one.int
getCharOctetLength()
org.datanucleus.store.schema.StoreSchemaData
getChild(int position)
java.util.List<org.datanucleus.store.schema.StoreSchemaData>
getChildren()
java.lang.String
getColumnDef()
java.lang.String
getColumnName()
int
getColumnSize()
short
getDataType()
int
getDecimalDigits()
java.lang.String
getIsNullable()
int
getNullable()
int
getNumberOfChildren()
int
getNumPrecRadix()
int
getOrdinalPosition()
org.datanucleus.store.schema.StoreSchemaData
getParent()
Accessor for the parent Table schema component.java.lang.Object
getProperty(java.lang.String name)
Accessor for a property.java.lang.String
getRemarks()
java.lang.String
getTableCat()
java.lang.String
getTableName()
java.lang.String
getTableSchem()
java.lang.String
getTypeName()
int
hashCode()
Returns a hash code value for this object.void
setColumnDef(java.lang.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.java.lang.String
toString()
Returns the string representation of this object.
-
-
-
Field Detail
-
tableCat
protected java.lang.String tableCat
The table catalog, which may be null.
-
tableSchem
protected java.lang.String tableSchem
The table schema, which may be null.
-
tableName
protected java.lang.String tableName
The table name.
-
columnName
protected java.lang.String columnName
The column name.
-
dataType
protected short dataType
Indicates the JDBC (SQL) data type fromTypes
.
-
typeName
protected java.lang.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 java.lang.String remarks
An explanatory comment on the column; may be null.
-
columnDef
protected java.lang.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 java.lang.String isNullable
Whether the column definitely doesnt allow NULL values ("NO") or possibly does ("YES").
-
hash
private int hash
Hashcode. Set on first use.
-
tableInfo
RDBMSTableInfo tableInfo
Parent table schema info.
-
-
Constructor Detail
-
RDBMSColumnInfo
public RDBMSColumnInfo(java.sql.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:
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
public void setColumnDef(java.lang.String def)
-
getDecimalDigits
public int getDecimalDigits()
-
getIsNullable
public java.lang.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 java.lang.String getColumnDef()
-
getRemarks
public java.lang.String getRemarks()
-
getTypeName
public java.lang.String getTypeName()
-
getTableName
public java.lang.String getTableName()
-
getColumnName
public java.lang.String getColumnName()
-
getTableCat
public java.lang.String getTableCat()
-
getTableSchem
public java.lang.String getTableSchem()
-
addProperty
public void addProperty(java.lang.String name, java.lang.Object value)
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
public java.lang.Object getProperty(java.lang.String name)
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
public java.util.List<org.datanucleus.store.schema.StoreSchemaData> getChildren()
- Specified by:
getChildren
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
getNumberOfChildren
public int getNumberOfChildren()
- Specified by:
getNumberOfChildren
in interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
equals
public final boolean equals(java.lang.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.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the reference object with which to compare- Returns:
- true if this object is equal to the obj argument; false otherwise.
-
hashCode
public final int hashCode()
Returns a hash code value for this object.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code value for this object.
-
toString
public java.lang.String toString()
Returns the string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- string representation of this object.
-
-