|
SolarMetric Kodo JDO 3.0.3 generated on February 20 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--kodo.meta.DelegatingExtensions
|
+--kodo.meta.DelegatingClassMetaData
|
+--kodo.jdbc.meta.ClassMapping
Mapping from a class to a relational schema.
In addition to the bean methods for simple metadata attributes, the
following methods are available before resolve() has been called:
getDeclaredFieldMapping(int),
getDeclaredFieldMapping(String), getDeclaredFieldMappings().
If the superclass mapping has been set or if this is a base class, then
getPrimaryKeyFieldMappings() and getPrimaryKeyColumns() are
also available before resolve.
| Field Summary | |
static String |
AUTO_INCREMENT
Extension indicating that this data store identity class has an auto-incrementing primary key column. |
static String |
CLASS_IND
Extension key used to indicate the type of class indicator to use, or "none" for none. |
static String |
CLASS_INDEXED
Whether the class indicator is indexed. |
static String |
CLASS_MAP
Extension key used to indicate the type of class mapping to use. |
static String |
REF_DELETE_ACTION
Extension key used to mark the foreign key delete action on vertically- mapped tables. |
static String |
SEQUENCE_FACTORY
Extension key used to indicate the sequence factory for this persistent type. |
static String |
VERSION_IND
Extension key used to indicate the type of version indicator to use, or "none" for none. |
static String |
VERSION_INDEXED
Whether the version indicator is 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 | |
ClassMapping(ClassMetaData meta)
Constructor. |
|
| Method Summary | |
void |
addDeclaredField(FieldMetaData field)
Add a persistent or transactional field to this class. |
protected void |
assertResolved()
Throw an exception if this mapping has not been resolved. |
void |
delete(KodoStateManager sm,
JDBCStoreManager store)
Override this method to customize flushing this mapping. |
abstract ClassIndicator |
getClassIndicator()
Return the class indicator for this class. |
int |
getClassIndicatorIndexed()
|
String |
getClassIndicatorName()
|
String |
getClassMappingName()
|
Object |
getDataStoreValue(Object obj,
Column[] cols)
Return the given column value(s) for the given object. |
protected DBDictionary |
getDBDictionary()
Return the dictionary to use. |
FieldMetaData |
getDeclaredField(int index)
Return the metadata for the persistent or transactional field with the given relative index. |
FieldMetaData |
getDeclaredField(String name)
Return the metadata for the persistent or transactional field with the given name, without including superclass fields. |
FieldMapping |
getDeclaredFieldMapping(int index)
Convenience method to make casting from getDeclaredField(int)
unnecessary. |
FieldMapping |
getDeclaredFieldMapping(String name)
Convenience method to make casting from getField(int)
unnecessary. |
FieldMapping[] |
getDeclaredFieldMappings()
Convenience method to make casting from getDeclaredFields()
unnecessary. |
FieldMetaData[] |
getDeclaredFields()
Return only the fields for this class, without superclass fields. |
FieldMapping[] |
getDefaultFetchGroupFieldMappings()
Convenience method to make casting from getDefaultFetchGroupFields() unnecessary. |
FieldMetaData[] |
getDefaultFetchGroupFields()
Return the list of fields in the default fetch group, including superclass fields, or an empty array if none. |
static ClassMapping[] |
getDefaults()
Return the set of default mapping types. |
FieldMapping |
getEmbeddingMapping()
If this is an embedded mapping, return the owning field. |
FieldMetaData |
getField(int index)
Return the metadata for the persistent or transactional field with the given absolute index. |
FieldMetaData |
getField(String name)
Return the metadata for the persistent or transactional field with the given name. |
FieldMapping |
getFieldMapping(int index)
Convenience method to make casting from getField(int) unnecessary. |
FieldMapping |
getFieldMapping(String name)
Convenience method to make casting from getField(int)
unnecessary. |
FieldMapping[] |
getFieldMappings()
Convenience method to make casting from getFields()
unnecessary. |
FieldMetaData[] |
getFields()
Return all field metadatas, including superclass fields. |
JoinableMapping |
getJoinableMapping(Column col)
Return the joinable mapping for the given column. |
ClassMappingInfo |
getMappingInfo()
Return the mapping info that was used to create this mapping, if any. |
MappingRepository |
getMappingRepository()
Return the repository for this mapping. |
Object |
getObjectId(Result res,
ForeignKey fk)
Return the oid value stored in the result. |
ClassMapping[] |
getPCSubclassMappings()
Convenience method to make casting from getPCSubclassMetaDatas()
unnecessary. |
ClassMetaData[] |
getPCSubclassMetaDatas()
Return the metadata for the known persistence capable subclasses of the described type, or empty array if none. |
ClassMapping |
getPCSuperclassMapping()
Convenience method to make casting from getPCSuperclassMetaData()
unnecessary. |
ClassMetaData |
getPCSuperclassMetaData()
Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one. |
abstract Column[] |
getPrimaryKeyColumns()
Return the columns this mapping uses to uniquely identify an object. |
FieldMapping[] |
getPrimaryKeyFieldMappings()
Convenience method to make casting from getPrimaryKeyFields()
unnecessary. |
FieldMetaData[] |
getPrimaryKeyFields()
Return primary key fields, or empty array if none. |
int |
getRefDeleteAction()
|
JDOMetaDataRepository |
getRepository()
Return the owning repository. |
String |
getSequenceFactory()
|
SequenceFactory |
getSequenceFactoryInstance()
Return the sequence factory for this type, based on its sequence factory metadata extensions. |
abstract VersionIndicator |
getVersionIndicator()
Return the version indicator for this class. |
int |
getVersionIndicatorIndexed()
|
String |
getVersionIndicatorName()
|
void |
insert(KodoStateManager sm,
JDBCStoreManager store)
Override this method to customize flushing this mapping. |
void |
invalidateResolve()
For implementation use. |
boolean |
isAutoIncrement()
|
Boolean |
isCustomDelete(KodoStateManager sm)
Return Boolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. |
Boolean |
isCustomInsert(KodoStateManager sm)
Return Boolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. |
Boolean |
isCustomUpdate(KodoStateManager sm)
Return Boolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. |
abstract 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()
|
boolean |
isResolved()
For implementation use. |
abstract void |
joinSuperclass(Joins joins)
Join the mapping to its superclass table. |
ResultObjectProvider |
load(JDBCStoreManager store,
boolean subclasses,
JDBCFetchConfiguration fetch)
Override this method to customize obtaining a result containing all instances of this class. |
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. |
static ClassMapping |
newInstance(String type,
ClassMetaData meta)
Return the mapping for the given mapping type. |
boolean |
removeDeclaredField(FieldMetaData field)
Remove the given field from management. |
void |
resolve()
For implementation use. |
void |
reverseMap(SchemaGroup schema,
ReverseMappingTool tool)
Create mappings from the schema, using the given tool. |
void |
setAutoIncrement(boolean autoInc)
|
void |
setAutoIncrementValue(KodoStateManager sm,
Column col,
Connection conn)
Set the next auto increment value for the given column into the given instance. |
abstract void |
setClassIndicator(ClassIndicator cls)
Set the class indicator for this class. |
void |
setClassIndicatorIndexed(int idx)
|
void |
setClassIndicatorName(String ind)
|
void |
setClassMappingName(String map)
|
void |
setMappingInfo(ClassMappingInfo info)
Set the mapping info that was used to create this class. |
void |
setPCSuperclassMapping(ClassMapping superMapping)
Set the superclass mapping. |
void |
setPCSuperclassMetaData(ClassMetaData meta)
Set the metadata for this class' superclass. |
void |
setRefDeleteAction(int action,
boolean deferred)
|
void |
setRepository(JDOMetaDataRepository repos)
The supplied repository must be a MappingRepository. |
void |
setSequenceFactory(String plugin)
|
abstract void |
setVersionIndicator(VersionIndicator version)
Set the version indicator for this class. |
void |
setVersionIndicatorIndexed(int idx)
|
void |
setVersionIndicatorName(String ind)
|
void |
update(KodoStateManager sm,
JDBCStoreManager store)
Override this method to customize flushing this mapping. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface kodo.jdbc.meta.Mapping |
delete, fromMappingInfo, getMappingType, getTable, insert, map, refSchemaComponents, toMappingInfo, update |
| Field Detail |
public static final String CLASS_MAP
public static final String VERSION_IND
public static final String CLASS_IND
public static final String VERSION_INDEXED
public static final String CLASS_INDEXED
public static final String REF_DELETE_ACTION
none,
exception, exception-deferred,
cascade, cascade-deferred. Defaults to
none.public static final String AUTO_INCREMENT
public static final String SEQUENCE_FACTORY
| Constructor Detail |
public ClassMapping(ClassMetaData meta)
| Method Detail |
public static ClassMapping newInstance(String type,
ClassMetaData meta)
public static ClassMapping[] getDefaults()
public MappingRepository getMappingRepository()
getMappingRepository in interface Mappingpublic ClassMappingInfo getMappingInfo()
public void setMappingInfo(ClassMappingInfo info)
public abstract VersionIndicator getVersionIndicator()
public abstract void setVersionIndicator(VersionIndicator version)
public abstract ClassIndicator getClassIndicator()
public abstract void setClassIndicator(ClassIndicator cls)
public FieldMapping getEmbeddingMapping()
public JoinableMapping getJoinableMapping(Column col)
public abstract Column[] getPrimaryKeyColumns()
public abstract boolean isPrimaryKeyObjectId(boolean hasAll)
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
public Object getObjectId(Result res,
ForeignKey fk)
throws SQLException
fk - if non-null, use the local columns of the given foreign
key in place of this class' primary key columnsisPrimaryKeyObjectId(boolean)
public void setAutoIncrementValue(KodoStateManager sm,
Column col,
Connection conn)
throws SQLException
public void reverseMap(SchemaGroup schema,
ReverseMappingTool tool)
MappingreverseMap in interface Mapping
public Object getDataStoreValue(Object obj,
Column[] cols)
public abstract void joinSuperclass(Joins joins)
public Boolean isCustomInsert(KodoStateManager sm)
MappingBoolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. Implement the
#insert(KodoStateManager,JDBCStoreManager,Connection) method
to implement the custom insertion behavior.isCustomInsert in interface Mappingpublic Boolean isCustomUpdate(KodoStateManager sm)
MappingBoolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. Implement the
#update(KodoStateManager,JDBCStoreManager,Connection) method
to override the default update behavior.isCustomUpdate in interface Mappingpublic Boolean isCustomDelete(KodoStateManager sm)
MappingBoolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. Implement the
#delete(KodoStateManager,JDBCStoreManager,Connection) method
to override the default deletion behavior.isCustomDelete in interface Mapping
public void insert(KodoStateManager sm,
JDBCStoreManager store)
throws SQLException
Mappinginsert in interface Mapping
public void update(KodoStateManager sm,
JDBCStoreManager store)
throws SQLException
Mappingupdate in interface Mapping
public void delete(KodoStateManager sm,
JDBCStoreManager store)
throws SQLException
Mappingdelete in interface Mapping
public ResultObjectProvider load(JDBCStoreManager store,
boolean subclasses,
JDBCFetchConfiguration fetch)
throws SQLException
public boolean load(KodoStateManager sm,
JDBCStoreManager store,
JDOState state,
JDBCFetchConfiguration fetch)
throws SQLException,
ClassNotFoundException
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
public boolean load(KodoStateManager sm,
JDBCStoreManager store,
JDBCFetchConfiguration fetch,
Result result)
throws SQLException
protected DBDictionary getDBDictionary()
public String getClassMappingName()
public void setClassMappingName(String map)
public String getVersionIndicatorName()
public void setVersionIndicatorName(String ind)
public String getClassIndicatorName()
public void setClassIndicatorName(String ind)
public int getVersionIndicatorIndexed()
public void setVersionIndicatorIndexed(int idx)
public int getClassIndicatorIndexed()
public void setClassIndicatorIndexed(int idx)
public int getRefDeleteAction()
public boolean isRefDeleteActionDeferred()
public void setRefDeleteAction(int action,
boolean deferred)
public String getSequenceFactory()
public void setSequenceFactory(String plugin)
public SequenceFactory getSequenceFactoryInstance()
public boolean isAutoIncrement()
public void setAutoIncrement(boolean autoInc)
public JDOMetaDataRepository getRepository()
ClassMetaDatagetRepository in class DelegatingClassMetaDatapublic void setRepository(JDOMetaDataRepository repos)
MappingRepository.setRepository in class DelegatingClassMetaDatapublic ClassMetaData getPCSuperclassMetaData()
ClassMetaDatagetPCSuperclassMetaData in class DelegatingClassMetaDatapublic ClassMapping getPCSuperclassMapping()
getPCSuperclassMetaData()
unnecessary.public void setPCSuperclassMetaData(ClassMetaData meta)
ClassMetaDatasetPCSuperclassMetaData in class DelegatingClassMetaDatapublic void setPCSuperclassMapping(ClassMapping superMapping)
ClassMappingInfos.public ClassMetaData[] getPCSubclassMetaDatas()
ClassMetaDatagetPCSubclassMetaDatas in class DelegatingClassMetaDatapublic ClassMapping[] getPCSubclassMappings()
getPCSubclassMetaDatas()
unnecessary.public FieldMetaData[] getFields()
ClassMetaDatagetFields in class DelegatingClassMetaDatapublic FieldMapping[] getFieldMappings()
getFields()
unnecessary.public FieldMetaData[] getDeclaredFields()
ClassMetaDatagetDeclaredFields in class DelegatingClassMetaDatapublic FieldMapping[] getDeclaredFieldMappings()
getDeclaredFields()
unnecessary.public FieldMetaData[] getPrimaryKeyFields()
ClassMetaDatagetPrimaryKeyFields in class DelegatingClassMetaDatapublic FieldMapping[] getPrimaryKeyFieldMappings()
getPrimaryKeyFields()
unnecessary.public FieldMetaData[] getDefaultFetchGroupFields()
ClassMetaDatagetDefaultFetchGroupFields in class DelegatingClassMetaDatapublic FieldMapping[] getDefaultFetchGroupFieldMappings()
getDefaultFetchGroupFields() unnecessary.public FieldMetaData getField(int index)
ClassMetaDatagetField in class DelegatingClassMetaDatakodo.meta.ClassMetaDatapublic FieldMapping getFieldMapping(int index)
getField(int) unnecessary.public FieldMetaData getDeclaredField(int index)
ClassMetaDatagetDeclaredField in class DelegatingClassMetaDatakodo.meta.ClassMetaDatapublic FieldMapping getDeclaredFieldMapping(int index)
getDeclaredField(int)
unnecessary.public FieldMetaData getField(String name)
ClassMetaDatagetField in class DelegatingClassMetaDatakodo.meta.ClassMetaDatapublic FieldMapping getFieldMapping(String name)
getField(int)
unnecessary.public FieldMetaData getDeclaredField(String name)
ClassMetaDatagetDeclaredField in class DelegatingClassMetaDatakodo.meta.ClassMetaDatapublic FieldMapping getDeclaredFieldMapping(String name)
getField(int)
unnecessary.public void addDeclaredField(FieldMetaData field)
ClassMetaDataaddDeclaredField in class DelegatingClassMetaDatapublic boolean removeDeclaredField(FieldMetaData field)
ClassMetaDataremoveDeclaredField in class DelegatingClassMetaDatakodo.meta.ClassMetaDatapublic boolean isResolved()
ClassMetaDataisResolved in class DelegatingClassMetaDatapublic void invalidateResolve()
ClassMetaDatainvalidateResolve in class DelegatingClassMetaDatapublic void resolve()
ClassMetaDataresolve in class DelegatingClassMetaDataprotected void assertResolved()
|
SolarMetric Kodo JDO 3.0.3 generated on February 20 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||