org.jpox.store.mapped
Interface DatastoreClass

All Superinterfaces:
DatastoreContainerObject, DatastoreObject
All Known Subinterfaces:
SecondaryDatastoreClass

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.37 $

Method Summary
 DatastoreClass getBaseDatastoreClassWithField(AbstractMemberMetaData 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 getExternalMapping(AbstractMemberMetaData fmd, int mappingType)
          Accessor for the external mapping for the specified field of the specified type.
 JavaTypeMapping getFieldMapping(AbstractMemberMetaData mmd)
          Accessor for the mapping for the specified field.
 JavaTypeMapping getFieldMapping(java.lang.String fieldName)
          Accessor for the mapping for the specified field name.
 JavaTypeMapping getFieldMappingInDatastoreClass(AbstractMemberMetaData mmd)
          Accessor for the mapping for the specified field only in this datastore class.
 IdentityType getIdentityType()
          Accessor for the identity-type used by this table.
 AbstractMemberMetaData getMetaDataForExternalMapping(JavaTypeMapping mapping, int mappingType)
          Accessor for the owner field metadata for the specified external mapping of the specified type
 java.util.Collection getSecondaryDatastoreClasses()
          Accessor for any secondary tables for this table.
 DatastoreClass getSuperDatastoreClass()
          Accessor for the supertable for this table.
 java.lang.String getType()
          Accessor for the primary class represented.
 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.
 boolean managesClass(java.lang.String className)
          Accessor for whether this table manages the specified class
 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 provideExternalMappings(MappingConsumer consumer, int mappingType)
          Instruction to provide all external mappings to the passed consumer.
 void provideMappingsForFields(MappingConsumer consumer, AbstractMemberMetaData[] 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 provideUnmappedDatastoreFields(MappingConsumer consumer)
          Instruction to provide all datastore fields without mappings.
 void provideVersionMappings(MappingConsumer consumer)
          Provide the mappings to version mappings
 java.lang.String toString()
          Accessor for the name of the datastore class (table).
 
Methods inherited from interface org.jpox.store.mapped.DatastoreContainerObject
addDatastoreField, getDatastoreFieldsMetaData, getDiscriminatorMapping, getDiscriminatorMetaData, getIDMapping, getVersionMapping, getVersionMetaData, hasDatastoreField
 
Methods inherited from interface org.jpox.store.mapped.DatastoreObject
getIdentifier, getStoreManager
 

Method Detail

getType

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

Returns:
Name of the class

getIdentityType

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

Returns:
identity-type tag value

isObjectIDDatastoreAttributed

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

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

Returns:
Whether it is the base.

getBaseDatastoreClassWithField

DatastoreClass getBaseDatastoreClassWithField(AbstractMemberMetaData 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

getSuperDatastoreClass

DatastoreClass getSuperDatastoreClass()
Accessor for the supertable for this table. This is only relevant if the DatastoreClass in use supports supertables. If supertables arent supported by the datastore then null is returned.

Returns:
The supertable (if any)

getSecondaryDatastoreClasses

java.util.Collection getSecondaryDatastoreClasses()
Accessor for any secondary tables for this table.

Returns:
Collection of secondary tables (if any)

managesClass

boolean managesClass(java.lang.String className)
Accessor for whether this table manages the specified class

Parameters:
className - Name of the class
Returns:
Whether it is managed by this table

toString

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

Overrides:
toString in class java.lang.Object
Returns:
The name

getDataStoreObjectIdMapping

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

Returns:
The (OID) mapping.

getFieldMapping

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

JavaTypeMapping getFieldMapping(AbstractMemberMetaData mmd)
Accessor for the mapping for the specified field.

Specified by:
getFieldMapping in interface DatastoreContainerObject
Parameters:
mmd - Metadata of the field/property
Returns:
The Mapping for the field.

getFieldMappingInDatastoreClass

JavaTypeMapping getFieldMappingInDatastoreClass(AbstractMemberMetaData mmd)
Accessor for the mapping for the specified field only in this datastore class.

Parameters:
mmd - Metadata of the field/property
Returns:
The Mapping for the field (or null if not present here)

provideDatastoreIdMappings

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

Parameters:
consumer - Consumer for the mappings

providePrimaryKeyMappings

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

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

void provideMappingsForFields(MappingConsumer consumer,
                              AbstractMemberMetaData[] 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

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

Parameters:
consumer - Consumer for the version mappings

provideDiscriminatorMappings

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

Parameters:
consumer - Consumer for the mappings

provideUnmappedDatastoreFields

void provideUnmappedDatastoreFields(MappingConsumer consumer)
Instruction to provide all datastore fields without mappings.

Parameters:
consumer - The consumer for the datastore fields

provideExternalMappings

void provideExternalMappings(MappingConsumer consumer,
                             int mappingType)
Instruction to provide all external mappings to the passed consumer.

Parameters:
consumer - The consumer for the mappings
mappingType - Type of external mapping to provide

getExternalMapping

JavaTypeMapping getExternalMapping(AbstractMemberMetaData fmd,
                                   int mappingType)
Accessor for the external mapping for the specified field of the specified type. An external mapping is a mapping for which there is no field in the actual class to represent it (part of a relation). The type can be FK, FK discriminator, order, etc

Parameters:
fmd - MetaData for the (external) field
mappingType - The type of mapping
Returns:
The external mapping

getMetaDataForExternalMapping

AbstractMemberMetaData getMetaDataForExternalMapping(JavaTypeMapping mapping,
                                                     int mappingType)
Accessor for the owner field metadata for the specified external mapping of the specified type

Parameters:
mapping - The external mapping
mappingType - The type of mapping
Returns:
Field MetaData in the owner class


Copyright © -2008 . All Rights Reserved.