Class RDBMSTablePKInfo

java.lang.Object
org.datanucleus.store.rdbms.schema.RDBMSTablePKInfo
All Implemented Interfaces:
org.datanucleus.store.schema.ListStoreSchemaData, org.datanucleus.store.schema.StoreSchemaData

public class RDBMSTablePKInfo extends Object implements org.datanucleus.store.schema.ListStoreSchemaData
Representation of PK information for a table in the datastore. Supports the properties :-
  • 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Hashcode.
    (package private) List<org.datanucleus.store.schema.StoreSchemaData>
    FK information for this table.
    (package private) Map<String,Object>
    Properties of the table.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    RDBMSTablePKInfo(String catalog, String schema, String table)
    Constructor taking just the catalog, schema and table name directly.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addChild(org.datanucleus.store.schema.StoreSchemaData child)
    Method to add another PK col to the table schema.
    void
    addProperty(String name, Object value)
    Method to add a property for the table.
    void
    Method to remove all children.
    final boolean
    Indicates whether some object is "equal to" this one.
    org.datanucleus.store.schema.StoreSchemaData
    getChild(int position)
    Accessor for the PK column at the position.
    List<org.datanucleus.store.schema.StoreSchemaData>
    Accessor for the primary keys
    int
    Accessor for the number of pk cols in the schema for this table.
    org.datanucleus.store.schema.StoreSchemaData
     
    Accessor for a property of the table.
    final int
    Returns a hash code value for this object.
    void
    setParent(org.datanucleus.store.schema.StoreSchemaData parent)
     
    Returns the string representation of this object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • hash

      private int hash
      Hashcode. Set on first use.
    • properties

      Map<String,Object> properties
      Properties of the table.
    • pks

      List<org.datanucleus.store.schema.StoreSchemaData> pks
      FK information for this table.
  • Constructor Details

    • RDBMSTablePKInfo

      public RDBMSTablePKInfo()
    • RDBMSTablePKInfo

      public RDBMSTablePKInfo(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
  • Method Details

    • addChild

      public void addChild(org.datanucleus.store.schema.StoreSchemaData child)
      Method to add another PK col 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 PK column at the position.
      Specified by:
      getChild in interface org.datanucleus.store.schema.ListStoreSchemaData
      Parameters:
      position - Index
      Returns:
      PK column at the position
    • getChildren

      public List<org.datanucleus.store.schema.StoreSchemaData> getChildren()
      Accessor for the primary keys
      Specified by:
      getChildren in interface org.datanucleus.store.schema.ListStoreSchemaData
      Returns:
      PK information
    • getNumberOfChildren

      public int getNumberOfChildren()
      Accessor for the number of pk cols in the schema for this table.
      Specified by:
      getNumberOfChildren in interface org.datanucleus.store.schema.ListStoreSchemaData
      Returns:
      Number of pk 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.