Package org.datanucleus.store.rdbms
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected DatastoreIdentifier
tableIdentifier
protected String
tableName
protected boolean
tableOwner
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatastoreIdentifier
getDatastoreIdentifier()
Accessor for the identifier for the table.String
getTableName()
Accessor for tableName.boolean
hasTable()
Accessor for whether this has a table representation.boolean
isTableOwner()
Accessor for whether this class is the owner of the table.boolean
mapsToView()
Utility to return whether this table is a view.void
setDatastoreContainerObject(DatastoreClass table)
Convenience to set the table.String
toString()
Method to return this class/field managed object as a string.
-
-
-
Field Detail
-
tableName
protected String tableName
-
tableIdentifier
protected DatastoreIdentifier tableIdentifier
-
tableOwner
protected boolean tableOwner
-
-
Constructor Detail
-
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/fieldtableName
- Name of the table associatedtableOwner
- Whether this is the ownertype
- 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 Detail
-
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 classorg.datanucleus.store.StoreData
- Returns:
- String version of this class/field managed object.
-
-