kodo.jdbc.meta
Class VerticalClassMapping
java.lang.Object
|
+--kodo.meta.DelegatingExtensions
|
+--kodo.meta.DelegatingClassMetaData
|
+--kodo.jdbc.meta.AbstractClassMapping
|
+--kodo.jdbc.meta.VerticalClassMapping
- All Implemented Interfaces:
- ClassMapping, ClassMetaData, Comparable, Extensions, Mapping, com.solarmetric.meta.SourceTracker
- public class VerticalClassMapping
- extends AbstractClassMapping
Mapping for classes that use a separate primary table than their
parent class.
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 |
Method Summary |
void |
addMappingInfoAttributes(Collection attrs)
Add all mapping attributes names used by this mapping to the given
collection. |
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. |
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. |
Column[] |
getPrimaryKeyColumns()
Return the columns this mapping uses to uniquely identify an object. |
ForeignKey |
getRefForeignKey()
Return the foreign key linking this mapping to the parent table. |
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. |
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 |
isVirtualMapping()
Returns false if this mapping represents a table in the database. |
Joins |
joinSuperclass(Joins joins,
boolean toThis)
Join the mapping and its superclass. |
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 |
setRefForeignKey(ForeignKey fk)
Set the foreign key linking this mapping to the parent table. |
void |
setVersionIndicator(VersionIndicator version)
Set the version indicator for this class. |
boolean |
supportsEagerSelect(Select sel,
KodoStateManager sm,
ClassMapping base,
JDBCStoreManager store,
JDBCFetchConfiguration fetch)
Return true if this mapping can perform the given select from
the given base mapping. |
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.AbstractClassMapping |
addDeclaredField, addExtensionKeys, assertResolved, createDefaultFieldMapping, delete, getClassIndicatorIndexed, getClassIndicatorName, getClassMappingName, getDataStoreValue, getDBDictionary, getDeclaredField, getDeclaredField, getDeclaredFieldMapping, getDeclaredFieldMapping, getDeclaredFieldMappings, getDeclaredFields, getDefaultFetchGroupFieldMappings, getDefaultFetchGroupFields, getEmbeddingMapping, getField, getField, getFieldMapping, getFieldMapping, getFieldMapping, getFieldMappings, getFields, getMappedFieldMappings, getMappingInfo, getMappingRepository, getMetaData, getNonVirtualMappings, getNonVirtualPCSuperclassMapping, getObjectId, getPCSubclassMappings, getPCSubclassMetaDatas, getPCSuperclassMapping, getPCSuperclassMetaData, getPrimaryKeyFieldMappings, getPrimaryKeyFields, getRefDeleteAction, getRepository, getSequenceFactory, getSequenceFactoryInstance, getVersionIndicatorIndexed, getVersionIndicatorName, insert, invalidateResolve, isAutoIncrement, isCustomDelete, isCustomInsert, isCustomUpdate, isRefDeleteActionDeferred, isResolved, load, load, load, 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, 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 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 |
TYPE
public static final String TYPE
VerticalClassMapping
public VerticalClassMapping(ClassMetaData meta)
- Constructor. Supply underlying metadata.
isVirtualMapping
public boolean isVirtualMapping()
- Description copied from interface:
ClassMapping
- Returns false if this mapping represents a table in the database.
getRefForeignKey
public ForeignKey getRefForeignKey()
- Return the foreign key linking this mapping to the parent table.
setRefForeignKey
public void setRefForeignKey(ForeignKey fk)
- Set the foreign key linking this mapping to the parent table.
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)
- Description copied from interface:
ClassMapping
- Set the version indicator for this class. Subclass mappings
should delegate this method to their superclass.
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)
- Description copied from interface:
ClassMapping
- Set the class indicator for this class. Subclass mappings
should delegate this method to their superclass.
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
getTable
public Table getTable()
- Description copied from interface:
Mapping
- Return the mapping's primary data table.
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
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 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)
addMappingInfoAttributes
public void addMappingInfoAttributes(Collection attrs)
- Description copied from interface:
Mapping
- Add all mapping attributes names used by this mapping to the given
collection. For foreign key attributes, add the prefix.
- Overrides:
addMappingInfoAttributes
in class AbstractClassMapping
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 AbstractClassMapping
refSchemaComponents
public void refSchemaComponents()
- Description copied from interface:
Mapping
- Increment the reference count of all used schema components.
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
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)
supportsEagerSelect
public boolean supportsEagerSelect(Select sel,
KodoStateManager sm,
ClassMapping base,
JDBCStoreManager store,
JDBCFetchConfiguration fetch)
- Description copied from interface:
ClassMapping
- Return true if this mapping can perform the given select from
the given
base
mapping.
The given state manager may be null if selecting multiple instances.
By default, returns true.
- Overrides:
supportsEagerSelect
in class AbstractClassMapping
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
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.