Class RDBMSTableInfo
java.lang.Object
org.datanucleus.store.rdbms.schema.RDBMSTableInfo
- All Implemented Interfaces:
org.datanucleus.store.schema.ListStoreSchemaData, org.datanucleus.store.schema.StoreSchemaData
public class RDBMSTableInfo
extends Object
implements org.datanucleus.store.schema.ListStoreSchemaData
Representation of table column information in the datastore.
Columns are stored as List-based, but also in a lookup Map keyed by the column name.
Supports the properties :-
- table_key : unique key under which this table is known (fully-qualified name)
- table_cat : catalog for this table (or null if not defined/supported)
- table_sch : schema for this table (or null if not defined/supported)
- table_name : name of the table
- time : time at which the information was provided
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap of column information keyed by the column name.(package private) List<org.datanucleus.store.schema.StoreSchemaData> Column information for this table.private intHashcode.Properties of the table. -
Constructor Summary
ConstructorsConstructorDescriptionRDBMSTableInfo(String catalog, String schema, String table) Constructor taking just the catalog, schema and table name directly.Constructor to create a table info definition for the current row of the passed ResultSet. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(org.datanucleus.store.schema.StoreSchemaData child) Method to add another column to the table schema.voidaddProperty(String name, Object value) Method to add a property for the table.voidMethod to remove all children.final booleanIndicates whether some object is "equal to" this one.org.datanucleus.store.schema.StoreSchemaDatagetChild(int position) Accessor for the column at the position.org.datanucleus.store.schema.StoreSchemaDataAccessor for the column with a particular name.List<org.datanucleus.store.schema.StoreSchemaData> Accessor for the columnsintAccessor for the number of columns in the schema for this table.org.datanucleus.store.schema.StoreSchemaDatagetProperty(String name) Accessor for a property of the table.final inthashCode()Returns a hash code value for this object.voidsetParent(org.datanucleus.store.schema.StoreSchemaData parent) toString()Returns the string representation of this object.
-
Field Details
-
hash
private int hashHashcode. Set on first use. -
properties
-
columns
List<org.datanucleus.store.schema.StoreSchemaData> columnsColumn information for this table. -
columnMapByColumnName
-
-
Constructor Details
-
RDBMSTableInfo
public RDBMSTableInfo() -
RDBMSTableInfo
-
RDBMSTableInfo
Constructor to create a table info definition for the current row of the passed ResultSet.- Parameters:
rs- ResultSet (from DatabaseMetaData.getTables() for example).- Throws:
org.datanucleus.exceptions.NucleusDataStoreException- Thrown if an error occurs getting the information
-
-
Method Details
-
addChild
public void addChild(org.datanucleus.store.schema.StoreSchemaData child) Method to add another column to the table schema.- Specified by:
addChildin interfaceorg.datanucleus.store.schema.ListStoreSchemaData- Parameters:
child- Column
-
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) Accessor for the column at the position.- Specified by:
getChildin interfaceorg.datanucleus.store.schema.ListStoreSchemaData- Parameters:
position- Index of the column- Returns:
- Column at the position
-
getChild
Accessor for the column with a particular name.- Parameters:
key- Name of the column- Returns:
- Column information
-
getChildren
Accessor for the columns- Specified by:
getChildrenin interfaceorg.datanucleus.store.schema.ListStoreSchemaData- Returns:
- Column schema information
-
getNumberOfChildren
public int getNumberOfChildren()Accessor for the number of columns in the schema for this table.- Specified by:
getNumberOfChildrenin interfaceorg.datanucleus.store.schema.ListStoreSchemaData- Returns:
- Number of cols
-
addProperty
-
getProperty
-
getParent
public org.datanucleus.store.schema.StoreSchemaData getParent()- Specified by:
getParentin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
setParent
public void setParent(org.datanucleus.store.schema.StoreSchemaData parent) - Specified by:
setParentin interfaceorg.datanucleus.store.schema.ListStoreSchemaData
-
equals
Indicates whether some object is "equal to" this one. Two RDBMSTableInfo are considered equal if their catalog, schema, table are all equal. -
hashCode
-
toString
-