SolarMetric Kodo JDO 3.0.3 generated on February 20 2004

kodo.jdbc.meta
Class BaseClassMapping

java.lang.Object
  |
  +--kodo.meta.DelegatingExtensions
        |
        +--kodo.meta.DelegatingClassMetaData
              |
              +--kodo.jdbc.meta.ClassMapping
                    |
                    +--kodo.jdbc.meta.BaseClassMapping
All Implemented Interfaces:
ClassMetaData, Comparable, Extensions, Mapping, com.solarmetric.meta.SourceTracker

public class BaseClassMapping
extends ClassMapping

Class mapping used for base classes in a persistent inheritance tree.


Field Summary
static String TYPE
           
 
Fields inherited from class kodo.jdbc.meta.ClassMapping
AUTO_INCREMENT, CLASS_IND, CLASS_INDEXED, CLASS_MAP, REF_DELETE_ACTION, SEQUENCE_FACTORY, VERSION_IND, VERSION_INDEXED
 
Fields inherited from interface kodo.meta.ClassMetaData
DATA_CACHE, DATA_CACHE_TIMEOUT, DETACH_OID_FIELD, DETACH_STATE_FIELD, DETACHABLE, ID_APPLICATION, ID_DATASTORE, ID_NONDURABLE, VALIDATE_ALL, VALIDATE_NONE, VALIDATE_NORESOLVE, VALIDATE_RUNTIME, VALIDATE_UNENHANCED
 
Constructor Summary
BaseClassMapping(ClassMetaData meta)
          Constructor.
 
Method Summary
 void delete(KodoStateManager sm, RowManager rm)
          Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates.
 void fromMappingInfo(MappingInfo info, boolean adapt)
          Deserialize this mapping from a simple MappingInfo instance parsed from XML or some other format.
 ClassIndicator getClassIndicator()
          Return the class indicator for this class.
 String getMappingType()
          Return the abbreviated name of this mapping, or the full class name if it is a custom mapping.
 Column[] getPrimaryKeyColumns()
          Return the columns this mapping uses to uniquely identify an object.
 Table getTable()
          Return the mapping's primary data table.
 VersionIndicator getVersionIndicator()
          Return the version indicator for this class.
 void insert(KodoStateManager sm, RowManager rm)
          Set values for the mapping into the proper rows.
 void invalidateResolve()
          For implementation use.
 boolean isPrimaryKeyObjectId(boolean hasAll)
          Return true if the this class' primary key columns correspond to the base class' primary key columns used to construct oid values.
 void joinSuperclass(Joins joins)
          Join the mapping to its superclass table.
 boolean map()
          Map a new instance of this mapping type.
 void refSchemaComponents()
          Increment the reference count of all used schema components.
 void resolve()
          For implementation use.
 void reverseMap(SchemaGroup schema, ReverseMappingTool tool)
          Create mappings from the schema, using the given tool.
 void setClassIndicator(ClassIndicator cls)
          Set the class indicator for this class.
 void setPrimaryKeyColumns(Column[] pkCols)
          Set the primary key columns for the mapping.
 void setTable(Table table)
          Set the table for the mapping.
 void setVersionIndicator(VersionIndicator version)
          Set the version indicator for this class.
 void toMappingInfo(MappingInfo info)
          Serialize this mapping to a simple MappingInfo instance for transfer to XML or some other format.
 void update(KodoStateManager sm, RowManager rm)
          Set values for the mapping into the proper rows.
 
Methods inherited from class kodo.jdbc.meta.ClassMapping
addDeclaredField, assertResolved, delete, getClassIndicatorIndexed, getClassIndicatorName, getClassMappingName, getDataStoreValue, getDBDictionary, getDeclaredField, getDeclaredField, getDeclaredFieldMapping, getDeclaredFieldMapping, getDeclaredFieldMappings, getDeclaredFields, getDefaultFetchGroupFieldMappings, getDefaultFetchGroupFields, getDefaults, getEmbeddingMapping, getField, getField, getFieldMapping, getFieldMapping, getFieldMappings, getFields, getJoinableMapping, getMappingInfo, getMappingRepository, getObjectId, getPCSubclassMappings, getPCSubclassMetaDatas, getPCSuperclassMapping, getPCSuperclassMetaData, getPrimaryKeyFieldMappings, getPrimaryKeyFields, getRefDeleteAction, getRepository, getSequenceFactory, getSequenceFactoryInstance, getVersionIndicatorIndexed, getVersionIndicatorName, insert, isAutoIncrement, isCustomDelete, isCustomInsert, isCustomUpdate, isRefDeleteActionDeferred, isResolved, load, load, load, newInstance, removeDeclaredField, setAutoIncrement, setAutoIncrementValue, setClassIndicatorIndexed, setClassIndicatorName, setClassMappingName, setMappingInfo, setPCSuperclassMapping, setPCSuperclassMetaData, setRefDeleteAction, setRepository, setSequenceFactory, setVersionIndicatorIndexed, setVersionIndicatorName, update
 
Methods inherited from class kodo.meta.DelegatingClassMetaData
compareTo, equals, getDataCache, getDataCacheName, getDataCacheTimeout, getDeclaredUnmanagedFields, getDelegate, getDescribedType, getDetachObjectId, getDetachObjectIdField, getDetachState, getDetachStateField, getIdentityType, getInnermostDelegate, getObjectIdClass, getPCSubclasses, getPCSuperclass, getPMClassLoader, getRequiresExtent, getSourceFile, getValidate, hashCode, isDetachable, isEnhanced, isInstanceCallbacks, setDataCacheName, setDataCacheTimeout, setDescribedType, setDetachable, setDetachObjectId, setDetachState, setIdentityType, setObjectIdClass, setPCSuperclass, setPMClassLoader, setRequiresExtent, setSourceFile, setValidate, toString
 
Methods inherited from class kodo.meta.DelegatingExtensions
addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface kodo.meta.Extensions
addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension
 

Field Detail

TYPE

public static final String TYPE
Constructor Detail

BaseClassMapping

public BaseClassMapping(ClassMetaData meta)
Constructor. Supply underlying metadata.
Method Detail

setTable

public void setTable(Table table)
Set the table for the mapping.

setPrimaryKeyColumns

public void setPrimaryKeyColumns(Column[] pkCols)
Set the primary key columns for the mapping. This is necessary when creating a mapping in memory that uses datastore identity.

getVersionIndicator

public VersionIndicator getVersionIndicator()
Description copied from class: ClassMapping
Return the version indicator for this class. Subclass mappings should delegate this method to their superclass.
Overrides:
getVersionIndicator in class ClassMapping

setVersionIndicator

public void setVersionIndicator(VersionIndicator version)
Description copied from class: ClassMapping
Set the version indicator for this class. Subclass mappings should delegate this method to their superclass.
Overrides:
setVersionIndicator in class ClassMapping

getClassIndicator

public ClassIndicator getClassIndicator()
Description copied from class: ClassMapping
Return the class indicator for this class. Subclass mappings should delegate this method to their superclass.
Overrides:
getClassIndicator in class ClassMapping

setClassIndicator

public void setClassIndicator(ClassIndicator cls)
Description copied from class: ClassMapping
Set the class indicator for this class. Subclass mappings should delegate this method to their superclass.
Overrides:
setClassIndicator in class ClassMapping

getTable

public Table getTable()
Description copied from interface: Mapping
Return the mapping's primary data table.

getPrimaryKeyColumns

public Column[] getPrimaryKeyColumns()
Description copied from class: ClassMapping
Return the columns this mapping uses to uniquely identify an object. These will typically be the primary key columns or the columns this class uses to link to its superclass table. This method must be available before resolve.
Overrides:
getPrimaryKeyColumns in class ClassMapping

isPrimaryKeyObjectId

public boolean isPrimaryKeyObjectId(boolean hasAll)
Description copied from class: ClassMapping
Return true if the this class' primary key columns correspond to the base class' primary key columns used to construct oid values. Base classes always return true. Classes that join to the base class table, though, may not always join using the same columns the base class uses for oid values, or may not use all the column. When performing a select, we will join down to the most-derived class that is identified by oid values. We cannot use non-primary key field values for joining during selects, because the field values to join on might be the ones we're trying to select! Similarly, we can only reconstruct oid values for selected object using classes whose primary keys store oid values.
Overrides:
isPrimaryKeyObjectId in class ClassMapping
Following copied from class: kodo.jdbc.meta.ClassMapping
Parameters:
hasAll - if true, there must be a primary key column for every base class primary key column; if false the primary key must only match a subset of the base class primary key columns

getMappingType

public String getMappingType()
Description copied from interface: Mapping
Return the abbreviated name of this mapping, or the full class name if it is a custom mapping.

toMappingInfo

public void toMappingInfo(MappingInfo info)
Description copied from interface: Mapping
Serialize this mapping to a simple MappingInfo instance for transfer to XML or some other format.

fromMappingInfo

public void fromMappingInfo(MappingInfo info,
                            boolean adapt)
Description copied from interface: Mapping
Deserialize this mapping from a simple MappingInfo instance parsed from XML or some other format. If the info is incompatible and adapt is true, try to adapt to the new info. This method must validate the given mapping information using the SchemaGroup.findTable(kodo.jdbc.schema.Table) method to find any needed tables, the Table.getColumn(java.lang.String) method to retrieve columns from those tables, and the Column.isCompatible(int, int) method to check all column types. This validation is important, as some schema groups use these methods to build themselves up dynamically rather than reading schema information from the database.
Following copied from interface: kodo.jdbc.meta.Mapping
Throws:
MappingInfoNotFoundException - if the given info is invalid

map

public boolean map()
Description copied from interface: Mapping
Map a new instance of this mapping type. If the underlying metadata cannot be mapped using this type, return false.

reverseMap

public void reverseMap(SchemaGroup schema,
                       ReverseMappingTool tool)
Description copied from interface: Mapping
Create mappings from the schema, using the given tool. Implement this method if you want the class mapping to be a candidate when reverse-mapping a schema to java classes. Note that this method will be invoked on a template instance, so you cannot rely on the metadata or owning repository being set.
Overrides:
reverseMap in class ClassMapping

refSchemaComponents

public void refSchemaComponents()
Description copied from interface: Mapping
Increment the reference count of all used schema components.

joinSuperclass

public void joinSuperclass(Joins joins)
Description copied from class: ClassMapping
Join the mapping to its superclass table.
Overrides:
joinSuperclass in class ClassMapping

insert

public void insert(KodoStateManager sm,
                   RowManager rm)
            throws SQLException
Description copied from interface: Mapping
Set values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.

update

public void update(KodoStateManager sm,
                   RowManager rm)
            throws SQLException
Description copied from interface: Mapping
Set values for the mapping into the proper rows.
Following copied from interface: kodo.jdbc.meta.Mapping
See Also:
Mapping.insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)

delete

public void delete(KodoStateManager sm,
                   RowManager rm)
            throws SQLException
Description copied from interface: Mapping
Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. This allows foreign key analysis.
Following copied from interface: kodo.jdbc.meta.Mapping
See Also:
Mapping.insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)

invalidateResolve

public void invalidateResolve()
Description copied from interface: ClassMetaData
For implementation use. Invalidate resolved data.
Overrides:
invalidateResolve in class ClassMapping

resolve

public void resolve()
Description copied from interface: ClassMetaData
For implementation use. This method resolves superclass information, caches fields, and resolves fields that might be other first class objects. It requires access to a respository. It can access other class metadata through the repository, but cannot access field metadata for those classes. It can, however, access superclass field metadata.
Overrides:
resolve in class ClassMapping

SolarMetric Kodo JDO 3.0.3 generated on February 20 2004

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.