Class 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
    • Constructor Detail

      • RDBMSTableInfo

        public RDBMSTableInfo()
      • RDBMSTableInfo

        public RDBMSTableInfo​(String catalog,
                              String schema,
                              String table)
        Constructor taking just the catalog, schema and table name directly.
        Parameters:
        catalog - Catalog containing the table
        schema - Schema containing the table
        table - The table name
      • RDBMSTableInfo

        public RDBMSTableInfo​(ResultSet rs)
        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 Detail

      • addChild

        public void addChild​(org.datanucleus.store.schema.StoreSchemaData child)
        Method to add another column to the table schema.
        Specified by:
        addChild in interface org.datanucleus.store.schema.ListStoreSchemaData
        Parameters:
        child - Column
      • clearChildren

        public void clearChildren()
        Method to remove all children.
        Specified by:
        clearChildren in interface org.datanucleus.store.schema.ListStoreSchemaData
      • getChild

        public org.datanucleus.store.schema.StoreSchemaData getChild​(int position)
        Accessor for the column at the position.
        Specified by:
        getChild in interface org.datanucleus.store.schema.ListStoreSchemaData
        Parameters:
        position - Index of the column
        Returns:
        Column at the position
      • getChild

        public org.datanucleus.store.schema.StoreSchemaData getChild​(String key)
        Accessor for the column with a particular name.
        Parameters:
        key - Name of the column
        Returns:
        Column information
      • getChildren

        public List<org.datanucleus.store.schema.StoreSchemaData> getChildren()
        Accessor for the columns
        Specified by:
        getChildren in interface org.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:
        getNumberOfChildren in interface org.datanucleus.store.schema.ListStoreSchemaData
        Returns:
        Number of cols
      • addProperty

        public void addProperty​(String name,
                                Object value)
        Method to add a property for the table.
        Specified by:
        addProperty in interface org.datanucleus.store.schema.StoreSchemaData
        Parameters:
        name - Name of property
        value - Its value
      • getProperty

        public Object getProperty​(String name)
        Accessor for a property of the table.
        Specified by:
        getProperty in interface org.datanucleus.store.schema.StoreSchemaData
        Parameters:
        name - Name of the property
        Returns:
        Its value, or null if not defined
      • getParent

        public org.datanucleus.store.schema.StoreSchemaData getParent()
        Specified by:
        getParent in interface org.datanucleus.store.schema.ListStoreSchemaData
      • setParent

        public void setParent​(org.datanucleus.store.schema.StoreSchemaData parent)
        Specified by:
        setParent in interface org.datanucleus.store.schema.ListStoreSchemaData
      • equals

        public final boolean equals​(Object obj)
        Indicates whether some object is "equal to" this one. Two RDBMSTableInfo are considered equal if their catalog, schema, table are all equal.
        Overrides:
        equals in class 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 class Object
        Returns:
        hash code
      • toString

        public String toString()
        Returns the string representation of this object.
        Overrides:
        toString in class Object
        Returns:
        string representation of this object.