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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.datanucleus.store.StoreData
org.datanucleus.store.StoreData.Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DatastoreIdentifier
protected String
protected boolean
Fields inherited from class org.datanucleus.store.StoreData
interfaceName, metadata, name, properties, table, type
-
Constructor Summary
ConstructorsConstructorDescriptionRDBMSStoreData
(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 TypeMethodDescriptionAccessor for the identifier for the table.Accessor for tableName.boolean
hasTable()
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.toString()
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
-
Field Details
-
tableName
-
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/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
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
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
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
Accessor for the identifier for the table.- Returns:
- The table identifier
-
setDatastoreContainerObject
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
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.
-