Class RDBMSStoreData

java.lang.Object
org.datanucleus.store.StoreData
org.datanucleus.store.rdbms.RDBMSStoreData

public class RDBMSStoreData extends org.datanucleus.store.StoreData
Representation of a class (FCO) / field (SCO) that is persisted to an RDBMS table. Extends the basic data to allow determination of whether it is a table or a view being represented.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.datanucleus.store.StoreData

    org.datanucleus.store.StoreData.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected String
     
    protected boolean
     

    Fields inherited from class org.datanucleus.store.StoreData

    interfaceName, metadata, name, properties, table, type
  • Constructor Summary

    Constructors
    Constructor
    Description
    RDBMSStoreData(String name, String tableName, boolean tableOwner, org.datanucleus.store.StoreData.Type type, String interfaceName)
    Constructor.
    RDBMSStoreData(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table)
    Constructor for SCO data.
    RDBMSStoreData(org.datanucleus.metadata.ClassMetaData cmd, Table table, boolean tableOwner)
    Constructor for FCO data.
  • Method Summary

    Modifier and Type
    Method
    Description
    Accessor for the identifier for the table.
    Accessor for tableName.
    boolean
    Accessor for whether this has a table representation.
    boolean
    Accessor for whether this class is the owner of the table.
    boolean
    Utility to return whether this table is a view.
    void
    Convenience to set the table.
    Method to return this class/field managed object as a string.

    Methods inherited from class org.datanucleus.store.StoreData

    addProperty, getInterfaceName, getMetaData, getName, getProperties, getProperty, getTable, getType, isFCO, isSCO, setMetaData, setTable

    Methods inherited from class java.lang.Object

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

    • tableName

      protected String tableName
    • tableIdentifier

      protected DatastoreIdentifier tableIdentifier
    • tableOwner

      protected boolean tableOwner
  • Constructor Details

    • RDBMSStoreData

      public RDBMSStoreData(String name, String tableName, boolean tableOwner, org.datanucleus.store.StoreData.Type type, String interfaceName)
      Constructor. To be used when creating for the auto-start mechanism.
      Parameters:
      name - Name of the class/field
      tableName - Name of the table associated
      tableOwner - Whether this is the owner
      type - The type (FCO/SCO)
      interfaceName - if this class is an implementation of a persistent interface (multiple persistent interface names are comma separated), otherwise is null.
    • RDBMSStoreData

      public RDBMSStoreData(org.datanucleus.metadata.ClassMetaData cmd, Table table, boolean tableOwner)
      Constructor for FCO data.
      Parameters:
      cmd - MetaData for the class.
      table - Table where the class is stored.
      tableOwner - Whether the class is the owner of the table.
    • RDBMSStoreData

      public RDBMSStoreData(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table)
      Constructor for SCO data. Takes in the meta data for the field, and the table it is mapped to.
      Parameters:
      mmd - MetaData for the field.
      table - Table definition
  • Method Details

    • mapsToView

      public boolean mapsToView()
      Utility to return whether this table is a view.
      Returns:
      Whether it is for a view.
    • getTableName

      public String getTableName()
      Accessor for tableName.
      Returns:
      Returns the tableName.
    • isTableOwner

      public boolean isTableOwner()
      Accessor for whether this class is the owner of the table.
      Returns:
      Whether it owns the table
    • hasTable

      public boolean hasTable()
      Accessor for whether this has a table representation.
      Returns:
      Whether it has a table
    • getDatastoreIdentifier

      public DatastoreIdentifier getDatastoreIdentifier()
      Accessor for the identifier for the table.
      Returns:
      The table identifier
    • setDatastoreContainerObject

      public void setDatastoreContainerObject(DatastoreClass table)
      Convenience to set the table. To be used in cases where the table isn't known until after the initial create
      Parameters:
      table - The table
    • toString

      public String toString()
      Method to return this class/field managed object as a string.
      Overrides:
      toString in class org.datanucleus.store.StoreData
      Returns:
      String version of this class/field managed object.