org.datanucleus.store.mapped
Class MappedStoreData

java.lang.Object
  extended by org.datanucleus.store.StoreData
      extended by org.datanucleus.store.mapped.MappedStoreData

public class MappedStoreData
extends StoreData

Representation of a class/field managed by the StoreManager where the datastore persists objects into a "DatastoreClass" (table).

Ownership of Tables

In DataNucleus, a class can have a table assigned where the class is not the "owner" of the table. This happens when the class has its fields persisted in the table of another class - so they share the table.


Field Summary
 
Fields inherited from class org.datanucleus.store.StoreData
FCO_TYPE, LOCALISER, name, properties, SCO_TYPE, type
 
Constructor Summary
MappedStoreData(AbstractMemberMetaData fmd, DatastoreContainerObject table)
          Constructor for SCO data.
MappedStoreData(ClassMetaData cmd, DatastoreContainerObject table, boolean tableOwner)
          Constructor for FCO data.
MappedStoreData(java.lang.String name, java.lang.String tableName, boolean tableOwner, int type, java.lang.String interfaceName)
          Constructor.
 
Method Summary
 DatastoreContainerObject getDatastoreContainerObject()
          Accessor for the Table details.
 DatastoreIdentifier getDatastoreIdentifier()
          Accessor for the identifier for the table.
 java.lang.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.
 void setDatastoreContainerObject(DatastoreClass table)
          Convenience to set the table.
 java.lang.String 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, getType, isFCO, isSCO, setMetaData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MappedStoreData

public MappedStoreData(java.lang.String name,
                       java.lang.String tableName,
                       boolean tableOwner,
                       int type,
                       java.lang.String interfaceName)
Constructor. To be used when creating for the 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.

MappedStoreData

public MappedStoreData(ClassMetaData cmd,
                       DatastoreContainerObject 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.

MappedStoreData

public MappedStoreData(AbstractMemberMetaData fmd,
                       DatastoreContainerObject table)
Constructor for SCO data.

Parameters:
fmd - MetaData for the field.
table - Table where the field is stored.
Method Detail

getTableName

public java.lang.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

getDatastoreContainerObject

public DatastoreContainerObject getDatastoreContainerObject()
Accessor for the Table details.

Returns:
The 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 java.lang.String toString()
Method to return this class/field managed object as a string.

Overrides:
toString in class StoreData
Returns:
String version of this class/field managed object.


Copyright © 2010. All Rights Reserved.