SolarMetric Kodo JDO 3.2.4 generated on January 7 2005

kodo.jdbc.meta
Class HorizontalClassMapping

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

public class HorizontalClassMapping
extends AbstractClassMapping

Mapping that relies on subclass mappings to define the fields. There is no primary table for this mapping.


Field Summary
static String TYPE
           
 
Fields inherited from interface kodo.jdbc.meta.ClassMapping
AUTO_INCREMENT, CLASS_IND, CLASS_INDEXED, CLASS_INDICATOR_VALUE, CLASS_MAP, EXTENSION_KEYS, REF_DELETE_ACTION, SEQUENCE_FACTORY, SEQUENCE_NAME, VERSION_IND, VERSION_INDEXED
 
Fields inherited from interface kodo.meta.ClassMetaData
AUDITABLE, DATA_CACHE, DATA_CACHE_TIMEOUT, DETACH_FALSE, DETACH_OID_FIELD, DETACH_SERIALIZE, DETACH_STATE_FIELD, DETACH_TRUE, DETACHABLE, ID_APPLICATION, ID_DATASTORE, ID_NONDURABLE, SUBCLASS_FETCH_MODE, VALIDATE_ALL, VALIDATE_NONE, VALIDATE_NORESOLVE, VALIDATE_RUNTIME, VALIDATE_UNENHANCED
 
Constructor Summary
HorizontalClassMapping(ClassMetaData cmd)
           
 
Method Summary
protected  FieldMapping createDefaultFieldMapping(FieldMetaData fmd)
          Create a default FieldMapping instance for this mapping type.
 void delete(KodoStateManager sm, JDBCStoreManager store)
          Override this method to customize flushing this mapping.
 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)
          The default implementation will raise warnings for any mapping attributes that are declared but not in the list of the valid attributes for this mapping.
 ClassIndicator getClassIndicator()
          Return the class indicator for this class.
 Object getDataStoreValue(Object obj, Column[] cols)
          Return the given column value(s) for the given object.
 FieldMapping getEmbeddingMapping()
          If this is an embedded mapping, return the owning field.
 JoinableMapping getJoinableMapping(Column col)
          Return the joinable mapping for the given column.
 String getMappingType()
          Return the abbreviated name of this mapping, or the full class name if it is a custom mapping.
 Object getObjectId(JDBCStoreManager store, Result res, ForeignKey fk)
           
 Column[] getPrimaryKeyColumns()
          Return the columns this mapping uses to uniquely identify an object.
 int getRefDeleteAction()
          The reference foreign key action.
 Table getTable()
          Horizontal mappings have no table.
 VersionIndicator getVersionIndicator()
          Return the version indicator for this class.
 void insert(KodoStateManager sm, JDBCStoreManager store)
          Override this method to customize flushing this mapping.
 void insert(KodoStateManager sm, RowManager rm)
          Set values for the mapping into the proper rows.
 boolean isAutoIncrement()
          True if this class uses an auto-increment datastore primary key.
 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.
 boolean isRefDeleteActionDeferred()
          The reference foreign key action.
 boolean isVirtualMapping()
          Returns true, since horizontal mappings do not have their own table.
 Joins joinSuperclass(Joins joins, boolean toThis)
          Join the mapping and its superclass.
 boolean load(KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch, Result result)
          Override this method to customize loading a Result into an instance.
 boolean load(KodoStateManager sm, JDBCStoreManager store, JDOState state, JDBCFetchConfiguration fetch)
          Override this method to load the state of a given object, returning true if this method handles the load.
 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 setAutoIncrementValue(KodoStateManager sm, Column col, Connection conn)
          Set the next auto increment value for the given column into the given instance.
 void setClassIndicator(ClassIndicator cls)
          Class indicators are ignored for horizontal mappings.
 void setVersionIndicator(VersionIndicator version)
          Version indicators are ignored for horizontal mappings.
 void toMappingInfo(MappingInfo info)
          Serialize this mapping to a simple MappingInfo instance for transfer to XML or some other format.
 void update(KodoStateManager sm, JDBCStoreManager store)
          Override this method to customize flushing this mapping.
 void update(KodoStateManager sm, RowManager rm)
          Set values for the mapping into the proper rows.
 
Methods inherited from class kodo.jdbc.meta.AbstractClassMapping
addDeclaredField, addExtensionKeys, addMappingInfoAttributes, assertResolved, getClassIndicatorIndexed, getClassIndicatorName, getClassMappingName, getDBDictionary, getDeclaredField, getDeclaredField, getDeclaredFieldMapping, getDeclaredFieldMapping, getDeclaredFieldMappings, getDeclaredFields, getDefaultFetchGroupFieldMappings, getDefaultFetchGroupFields, getField, getField, getFieldMapping, getFieldMapping, getFieldMapping, getFieldMappings, getFields, getMappedFieldMappings, getMappingInfo, getMappingRepository, getMetaData, getNonVirtualMappings, getNonVirtualPCSuperclassMapping, getObjectId, getPCSubclassMappings, getPCSubclassMetaDatas, getPCSuperclassMapping, getPCSuperclassMetaData, getPrimaryKeyFieldMappings, getPrimaryKeyFields, getRepository, getSequenceFactory, getSequenceFactoryInstance, getVersionIndicatorIndexed, getVersionIndicatorName, invalidateResolve, isCustomDelete, isCustomInsert, isCustomUpdate, isResolved, load, removeDeclaredField, setAutoIncrement, setClassIndicatorIndexed, setClassIndicatorName, setClassMappingName, setMappingInfo, setPCSuperclassMapping, setPCSuperclassMetaData, setRefDeleteAction, setRepository, setSequenceFactory, setVersionIndicatorIndexed, setVersionIndicatorName, supportsEagerSelect
 
Methods inherited from class kodo.meta.DelegatingClassMetaData
compareTo, equals, getDataCache, getDataCacheName, getDataCacheTimeout, getDeclaredUnmanagedFields, getDelegate, getDescribedType, getDetachable, getDetachObjectId, getDetachObjectIdField, getDetachState, getDetachStateField, getIdentityType, getInnermostDelegate, getObjectIdClass, getPCSubclasses, getPCSuperclass, getPMClassLoader, getRequiresExtent, getSourceFile, getSubclassFetchMode, getValidate, hashCode, isEnhanced, isInstanceCallbacks, isMemberField, setDataCacheName, setDataCacheTimeout, setDescribedType, setDetachable, setDetachObjectId, setDetachState, setIdentityType, setObjectIdClass, setPCSuperclass, setPMClassLoader, setRequiresExtent, setSourceFile, setSubclassFetchMode, 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.ClassMetaData
getDataCache, getDataCacheName, getDataCacheTimeout, getDeclaredUnmanagedFields, getDescribedType, getDetachable, getDetachObjectId, getDetachObjectIdField, getDetachState, getDetachStateField, getIdentityType, getObjectIdClass, getPCSubclasses, getPCSuperclass, getPMClassLoader, getRequiresExtent, getSourceFile, getSubclassFetchMode, getValidate, isEnhanced, isInstanceCallbacks, isMemberField, setDataCacheName, setDataCacheTimeout, setDescribedType, setDetachable, setDetachObjectId, setDetachState, setIdentityType, setObjectIdClass, setPCSuperclass, setPMClassLoader, setRequiresExtent, setSourceFile, setSubclassFetchMode, setValidate
 
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
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

TYPE

public static final String TYPE
Constructor Detail

HorizontalClassMapping

public HorizontalClassMapping(ClassMetaData cmd)
Method Detail

isVirtualMapping

public boolean isVirtualMapping()
Returns true, since horizontal mappings do not have their own table.

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 AbstractClassMapping

createDefaultFieldMapping

protected FieldMapping createDefaultFieldMapping(FieldMetaData fmd)
Description copied from class: AbstractClassMapping
Create a default FieldMapping instance for this mapping type. This will override any mapping the repository claims for the class mapping.
Overrides:
createDefaultFieldMapping in class AbstractClassMapping

load

public boolean load(KodoStateManager sm,
                    JDBCStoreManager store,
                    JDOState state,
                    JDBCFetchConfiguration fetch)
             throws SQLException,
                    ClassNotFoundException
Description copied from interface: ClassMapping

Override this method to load the state of a given object, returning true if this method handles the load. If the object does not exist in the data store, simply take no action on it (but still return true). Returns false by default.

This method is invoked when Kodo has not performed any query against the database yet. This means that you must go to the database to fetch the needed data for this call. Contrast with ClassMapping.load(KodoStateManager,JDBCStoreManager,JDBCFetchConfiguration,Result).

Overrides:
load in class AbstractClassMapping
Following copied from interface: kodo.jdbc.meta.ClassMapping
Parameters:
state - if non-null, then you must initialize the state and persistent object of the given state manager (after determining the actual class of the object from the database, if there are possible persistent subclasses); initialization looks like this: sm.initialize (ImplHelper.getJDOHelper ().newInstance (pcClass, sm, sm.getObjectId (false, false)), state); , where the ImplHelper class is in the kodo.util package

load

public boolean load(KodoStateManager sm,
                    JDBCStoreManager store,
                    JDBCFetchConfiguration fetch,
                    Result result)
             throws SQLException
Description copied from interface: ClassMapping

Override this method to customize loading a Result into an instance. Return true if this mapping handles the load; false if normal loading should procede after calling this method. Returns false by default.

This method is invoked when Kodo needs to load a record and has already performed a query (via JDOQL, direct SQL, or via some other mechanism by which Kodo can perform bulk loads). You should attempt to load fields from result before performing any additional selects against the database.

Overrides:
load in class AbstractClassMapping

getVersionIndicator

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

setVersionIndicator

public void setVersionIndicator(VersionIndicator version)
Version indicators are ignored for horizontal mappings.

getClassIndicator

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

setClassIndicator

public void setClassIndicator(ClassIndicator cls)
Class indicators are ignored for horizontal mappings.

getEmbeddingMapping

public FieldMapping getEmbeddingMapping()
Description copied from interface: ClassMapping
If this is an embedded mapping, return the owning field. Returns null by default.
Overrides:
getEmbeddingMapping in class AbstractClassMapping

getJoinableMapping

public JoinableMapping getJoinableMapping(Column col)
Description copied from interface: ClassMapping
Return the joinable mapping for the given column. Any column that another mapping joins to must be controlled by a joinable mapping, unless it is a datastore identity column. This base class takes care of caching joinable mappings for all fields, and detecting requests for the datastore identity column. Class mappings that must link to their superclass table will usually have additional joinable mappings for the columns used for linking.
Overrides:
getJoinableMapping in class AbstractClassMapping

getPrimaryKeyColumns

public Column[] getPrimaryKeyColumns()
Description copied from interface: 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.

isPrimaryKeyObjectId

public boolean isPrimaryKeyObjectId(boolean hasAll)
Description copied from interface: 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 columns. 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.
Following copied from interface: 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

getObjectId

public Object getObjectId(JDBCStoreManager store,
                          Result res,
                          ForeignKey fk)
                   throws SQLException

setAutoIncrementValue

public void setAutoIncrementValue(KodoStateManager sm,
                                  Column col,
                                  Connection conn)
                           throws SQLException
Description copied from interface: ClassMapping
Set the next auto increment value for the given column into the given instance.
Overrides:
setAutoIncrementValue in class AbstractClassMapping

getDataStoreValue

public Object getDataStoreValue(Object obj,
                                Column[] cols)
Description copied from interface: ClassMapping
Return the given column value(s) for the given object. The given columns will be primary key columns of this mapping, but may be in any order. If there is only one column, return its value. If there are multiple columns, return an object array of their values, in the same order the columns are given.
Overrides:
getDataStoreValue in class AbstractClassMapping

joinSuperclass

public Joins joinSuperclass(Joins joins,
                            boolean toThis)
Description copied from interface: ClassMapping
Join the mapping and its superclass.
Following copied from interface: kodo.jdbc.meta.ClassMapping
Parameters:
toThis - if false, inner join to the superclass table; if true, outer join from the superclass table to this table

getRefDeleteAction

public int getRefDeleteAction()
Description copied from interface: ClassMapping
The reference foreign key action.
Overrides:
getRefDeleteAction in class AbstractClassMapping

isRefDeleteActionDeferred

public boolean isRefDeleteActionDeferred()
Description copied from interface: ClassMapping
The reference foreign key action.
Overrides:
isRefDeleteActionDeferred in class AbstractClassMapping

isAutoIncrement

public boolean isAutoIncrement()
Description copied from interface: ClassMapping
True if this class uses an auto-increment datastore primary key.
Overrides:
isAutoIncrement in class AbstractClassMapping

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.

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.

delete

public void delete(KodoStateManager sm,
                   JDBCStoreManager store)
            throws SQLException
Description copied from interface: Mapping
Override this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method will be called after the owning object is deleted.
Overrides:
delete in class AbstractClassMapping

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)

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.

insert

public void insert(KodoStateManager sm,
                   JDBCStoreManager store)
            throws SQLException
Description copied from interface: Mapping
Override this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method is called after the owning object is inserted, so if this field is in a row with other fields, that row will already exist.
Overrides:
insert in class AbstractClassMapping

update

public void update(KodoStateManager sm,
                   JDBCStoreManager store)
            throws SQLException
Description copied from interface: Mapping
Override this method to customize flushing this mapping. For classes, this method must also flush all fields.
Overrides:
update in class AbstractClassMapping

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)

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 class: AbstractClassMapping
The default implementation will raise warnings for any mapping attributes that are declared but not in the list of the valid attributes for this mapping.
Overrides:
fromMappingInfo in class AbstractClassMapping
Following copied from class: kodo.jdbc.meta.AbstractClassMapping
See Also:
AbstractClassMapping.addMappingInfoAttributes(java.util.Collection)

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 AbstractClassMapping

getTable

public Table getTable()
Horizontal mappings have no table.

refSchemaComponents

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

SolarMetric Kodo JDO 3.2.4 generated on January 7 2005

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