org.jpox.store
Interface DatastoreClass

All Superinterfaces:
DatastoreContainerObject, DatastoreObject
All Known Implementing Classes:
ClassTable, ClassView, SecondaryTable

public interface DatastoreClass
extends DatastoreContainerObject

Representation of a Java class in a datastore. In the case of RDBMS this will be a table (primary or secondary). In the case of a file-based structure this may be a directory. In the case of an XML-based structure this may be an element.

Version:
$Revision: 1.23 $

Method Summary
 void delete(StateManager sm)
          Method to delete an object for this class.
 void deleteDependent(StateManager sm, AbstractPropertyMetaData[] fieldMetaData)
          Delete dependent objects of a persistent object.
 void fetch(StateManager sm, AbstractPropertyMetaData[] fieldMetaData)
          Method to fetch an object for this class.
 DatastoreClass getBaseDatastoreClassWithField(AbstractPropertyMetaData fmd)
          Method to return the base DatastoreClass that persists the specified field.
 JavaTypeMapping getDataStoreObjectIdMapping()
          Accessor for a mapping for the datastore ID (OID) for this object.
 JavaTypeMapping getExternalFkDiscriminatorMapping(AbstractPropertyMetaData fmd)
          Accessor for the external FK discriminator mapping for an owner field.
 JavaTypeMapping getExternalFkMapping(AbstractPropertyMetaData fmd)
          Accessor for the external FK mapping for an owner field.
 JavaTypeMapping getExternalOrderMapping(AbstractPropertyMetaData fmd)
          Accessor for the external order mapping specified by the field.
 JavaTypeMapping getFieldMapping(AbstractPropertyMetaData fmd)
          Accessor for the mapping for the specified field.
 JavaTypeMapping getFieldMapping(java.lang.String fieldName)
          Accessor for the mapping for the specified field name.
 AbstractPropertyMetaData getFieldMetaData(java.lang.String fieldName)
          Acessor for the FieldMetaData of a field.
 IdentityType getIdentityType()
          Accessor for the identity-type used by this table.
 java.lang.String getType()
          Accessor for the primary class represented.
 void insert(StateManager sm)
          Method to insert an object for this class.
 boolean isBaseDatastoreClass()
          Accessor for whether this datastore class is the base datastore class for this inheritance hierarchy.
 boolean isObjectIDDatastoreAttributed()
          Accessor for whether the object id will be attributed by the datastore directly, or whether values have to be supplied.
 void locate(StateManager sm)
          Locates this object in the datastore.
 java.lang.Object newOID(PersistenceManager pm, javax.jdo.spi.PersistenceCapable pcClass)
          Create a new OID.
 void provideDatastoreIdMappings(MappingConsumer consumer)
          Accessor for a mapping for the datastore ID (OID) for this table.
 void provideDiscriminatorMappings(MappingConsumer consumer)
          Provide the mappings to discriminator mappings
 void provideExternalFkMappings(MappingConsumer consumer)
          Provide the mappings to external FK mappings
 void provideExternalOrderMappings(MappingConsumer consumer)
          Provide the mappings to external order mappings
 void provideMappingsForFields(MappingConsumer consumer, AbstractPropertyMetaData[] fieldMetaData, boolean includeSecondaryTables)
          Provide the mappings to the consumer for all absolute field Numbers in this table that are container in the fieldNumbers parameter.
 void provideNonPrimaryKeyMappings(MappingConsumer consumer)
          Provide the mappings to the consumer for all non primary-key fields mapped to this table.
 void providePrimaryKeyMappings(MappingConsumer consumer)
          Provide the mappings to the consumer for all primary-key fields mapped to this table (for application identity).
 void provideVersionMappings(MappingConsumer consumer)
          Provide the mappings to version mappings
 java.lang.String toString()
          Accessor for the name of the datastore class (table).
 void update(StateManager sm, AbstractPropertyMetaData[] fieldMetaData)
          Method to update an object for this class.
 
Methods inherited from interface org.jpox.store.DatastoreContainerObject
addDatastoreField, getDiscriminatorMapping, getDiscriminatorMetaData, getIDMapping, getVersionMapping, getVersionMetaData, hasDatastoreField
 
Methods inherited from interface org.jpox.store.DatastoreObject
getIdentifier, getStoreManager
 

Method Detail

getType

public java.lang.String getType()
Accessor for the primary class represented.

Returns:
Name of the class

getIdentityType

public IdentityType getIdentityType()
Accessor for the identity-type used by this table.

Returns:
identity-type tag value

isObjectIDDatastoreAttributed

public boolean isObjectIDDatastoreAttributed()
Accessor for whether the object id will be attributed by the datastore directly, or whether values have to be supplied.

Returns:
Whether it is attributed in the datastore

isBaseDatastoreClass

public boolean isBaseDatastoreClass()
Accessor for whether this datastore class is the base datastore class for this inheritance hierarchy.

Returns:
Whether it is the base.

getBaseDatastoreClassWithField

public DatastoreClass getBaseDatastoreClassWithField(AbstractPropertyMetaData fmd)
Method to return the base DatastoreClass that persists the specified field. This navigates up through the superclass tables to find a table that manages the field.

Parameters:
fmd - MetaData for the field required
Returns:
The DatastoreClass managing that field

insert

public void insert(StateManager sm)
Method to insert an object for this class. Will insert any superclass records as well (recursive).

Parameters:
sm - StateManager for the object to insert.

fetch

public void fetch(StateManager sm,
                  AbstractPropertyMetaData[] fieldMetaData)
Method to fetch an object for this class. Will fetch any superclass records as well (recursive).

Parameters:
sm - StateManager for the object to fetch.
fieldMetaData - MetaData for the fields to be fetched

update

public void update(StateManager sm,
                   AbstractPropertyMetaData[] fieldMetaData)
Method to update an object for this class. Will update any superclass records as well (recursive).

Parameters:
sm - StateManager for the object to update.
fieldMetaData - MetaData for the fields to be updated

delete

public void delete(StateManager sm)
Method to delete an object for this class. Will delete any superclass records as well (recursive).

Parameters:
sm - StateManager for the object to delete.

locate

public void locate(StateManager sm)
Locates this object in the datastore.

Parameters:
sm - The StateManager for the object to be found
Throws:
javax.jdo.JDOObjectNotFoundException - If the instance does not exist in the datastore

deleteDependent

public void deleteDependent(StateManager sm,
                            AbstractPropertyMetaData[] fieldMetaData)
Delete dependent objects of a persistent object.

Parameters:
sm - StateManager for the object being deleted.
fieldMetaData - MetaData for the fields to delete.
Since:
1.1

getFieldMetaData

public AbstractPropertyMetaData getFieldMetaData(java.lang.String fieldName)
Acessor for the FieldMetaData of a field.

Parameters:
fieldName - the field name
Returns:
the FieldMetaData

toString

public java.lang.String toString()
Accessor for the name of the datastore class (table).

Returns:
The name

getDataStoreObjectIdMapping

public JavaTypeMapping getDataStoreObjectIdMapping()
Accessor for a mapping for the datastore ID (OID) for this object.

Returns:
The (OID) mapping.

getFieldMapping

public JavaTypeMapping getFieldMapping(java.lang.String fieldName)
Accessor for the mapping for the specified field name. Doesn't cope with fields of the same name in different subclasses - you should call the equivalent method passing FieldMetaData for those.

Parameters:
fieldName - Name of field
Returns:
The Mapping for the field.

getFieldMapping

public JavaTypeMapping getFieldMapping(AbstractPropertyMetaData fmd)
Accessor for the mapping for the specified field.

Specified by:
getFieldMapping in interface DatastoreContainerObject
Parameters:
fmd - AbstractPropertyMetaData of the field
Returns:
The Mapping for the field.

provideDatastoreIdMappings

public void provideDatastoreIdMappings(MappingConsumer consumer)
Accessor for a mapping for the datastore ID (OID) for this table.

Parameters:
consumer - Consumer for the mappings

providePrimaryKeyMappings

public void providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to this table (for application identity).

Parameters:
consumer - Consumer for the mappings

provideNonPrimaryKeyMappings

public void provideNonPrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all non primary-key fields mapped to this table.

Parameters:
consumer - Consumer for the mappings

provideMappingsForFields

public void provideMappingsForFields(MappingConsumer consumer,
                                     AbstractPropertyMetaData[] fieldMetaData,
                                     boolean includeSecondaryTables)
Provide the mappings to the consumer for all absolute field Numbers in this table that are container in the fieldNumbers parameter.

Parameters:
consumer - Consumer for the mappings
fieldMetaData - MetaData of the fields to provide mappings for
includeSecondaryTables - Whether to supply fields in secondary tables

provideVersionMappings

public void provideVersionMappings(MappingConsumer consumer)
Provide the mappings to version mappings

Parameters:
consumer - Consumer for the version mappings

provideDiscriminatorMappings

public void provideDiscriminatorMappings(MappingConsumer consumer)
Provide the mappings to discriminator mappings

Parameters:
consumer - Consumer for the mappings

provideExternalFkMappings

public void provideExternalFkMappings(MappingConsumer consumer)
Provide the mappings to external FK mappings

Parameters:
consumer - Consumer for the mappings

provideExternalOrderMappings

public void provideExternalOrderMappings(MappingConsumer consumer)
Provide the mappings to external order mappings

Parameters:
consumer - Consumer for the mappings

newOID

public java.lang.Object newOID(PersistenceManager pm,
                               javax.jdo.spi.PersistenceCapable pcClass)
Create a new OID. OID can be datastore identity or application identity

Parameters:
pm - The PersistenceManager
pcClass - The Persistence-Capable class
Returns:
New OID

getExternalOrderMapping

public JavaTypeMapping getExternalOrderMapping(AbstractPropertyMetaData fmd)
Accessor for the external order mapping specified by the field.

Parameters:
fmd - The metadata for the List field.
Returns:
The index mapping for the specified field.

getExternalFkDiscriminatorMapping

public JavaTypeMapping getExternalFkDiscriminatorMapping(AbstractPropertyMetaData fmd)
Accessor for the external FK discriminator mapping for an owner field.

Parameters:
fmd - The metadata for the field.
Returns:
The external mapping for the specified field.

getExternalFkMapping

public JavaTypeMapping getExternalFkMapping(AbstractPropertyMetaData fmd)
Accessor for the external FK mapping for an owner field.

Parameters:
fmd - The metadata for the field.
Returns:
The external mapping for the specified field.


Copyright © -2007 . All Rights Reserved.