org.jpox.store
Class StoreData

java.lang.Object
  extended byorg.jpox.store.StoreData
Direct Known Subclasses:
RDBMSStoreData

public class StoreData
extends java.lang.Object

Representation of a class/field managed by the StoreManager.

Type of data

There are 2 constructors, one for specifying a class (FCO) being managed, and one for specifying a field (SCO) being managed. The "type" is set accordingly to represent which one is being used.

Ownership of Tables

In JPOX, 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.

Version:
$Revision: 1.7 $

Field Summary
static int FCO_TYPE
          First class object (FCO) type
protected  java.lang.String interfaceName
          If this class is an implementation of a persistent interface, this attribute will hold the name of the interface.
protected  boolean isTableOwner
          Whether this class is the owner of the table.
protected static Localiser LOCALISER
          Localiser for messages.
protected  ExtendableMetaData metaData
          MetaData for this object.
protected  java.lang.String name
          Name of the class/field.
static int SCO_TYPE
          Second class object (SCO) type
protected  DatastoreContainerObject table
          The datastore container (table) where this class/field is persisted.
protected  java.lang.String tableName
          Name of the datastore object where it is stored.
protected  int type
          Type of data being stored.
 
Constructor Summary
StoreData(AbstractPropertyMetaData fmd, DatastoreContainerObject table)
          Constructor for SCO data.
StoreData(ClassMetaData cmd, DatastoreContainerObject table, boolean tableOwner)
          Constructor for FCO data.
StoreData(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 getInterfaceName()
          Accessor for the persistent interface name
 ExtendableMetaData getMetaData()
          Accessor for class/field meta data.
 java.lang.String getName()
          Accessor for class/field name.
 java.lang.String getSuperclass()
          Accessor for any superclass for this class, if this is a class.
 java.lang.String getTableName()
          Accessor for tableName.
 int getType()
          Accessor for type.
 boolean hasTable()
          Accessor for whether this has a table representation.
 boolean isFCO()
          Accessor for whether this represents FCO data
 boolean isSCO()
          Accessor for whether this represents SCO data.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for messages.


FCO_TYPE

public static final int FCO_TYPE
First class object (FCO) type

See Also:
Constant Field Values

SCO_TYPE

public static final int SCO_TYPE
Second class object (SCO) type

See Also:
Constant Field Values

name

protected final java.lang.String name
Name of the class/field.


interfaceName

protected final java.lang.String interfaceName
If this class is an implementation of a persistent interface, this attribute will hold the name of the interface.


tableName

protected java.lang.String tableName
Name of the datastore object where it is stored.


isTableOwner

protected final boolean isTableOwner
Whether this class is the owner of the table.


type

protected final int type
Type of data being stored.


metaData

protected final ExtendableMetaData metaData
MetaData for this object.


table

protected DatastoreContainerObject table
The datastore container (table) where this class/field is persisted.

Constructor Detail

StoreData

public StoreData(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.

StoreData

public StoreData(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.

StoreData

public StoreData(AbstractPropertyMetaData fmd,
                 DatastoreContainerObject table)
Constructor for SCO data.

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

getName

public java.lang.String getName()
Accessor for class/field name.

Returns:
Returns the class/field name.

getInterfaceName

public java.lang.String getInterfaceName()
Accessor for the persistent interface name

Returns:
Returns the persistent interface name

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

isFCO

public boolean isFCO()
Accessor for whether this represents FCO data

Returns:
Whether it is FCO

isSCO

public boolean isSCO()
Accessor for whether this represents SCO data.

Returns:
Whether it is SCO.

getType

public int getType()
Accessor for type.

Returns:
Returns the type.

getSuperclass

public java.lang.String getSuperclass()
Accessor for any superclass for this class, if this is a class.

Returns:
The superclass (if exists). If this is a field, just return null.

getMetaData

public ExtendableMetaData getMetaData()
Accessor for class/field meta data.

Returns:
Returns the class/field meta data.

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.

Returns:
String version of this class/field managed object.


Copyright © -2007 . All Rights Reserved.