|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Mapping from a class to a relational schema.
In addition to the bean methods for simple metadata attributes, the
following methods are available before ClassMetaData.resolve()
has been called:
isVirtualMapping()
,
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_INDICATOR_VALUE
Extension key used to specify the column class indicator value for this class. |
static String |
CLASS_MAP
Extension key used to indicate the type of class mapping to use. |
static String[] |
EXTENSION_KEYS
The list of all the recognized extension keys. |
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 |
SEQUENCE_NAME
The name of the sequence that we will use, in the case of a custom sequence factory that uses database sequences. |
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_FALSE, DETACH_OID_FIELD, DETACH_SERIALIZE, DETACH_STATE_FIELD, DETACH_TRUE, DETACHABLE, ID_APPLICATION, ID_DATASTORE, ID_NONDURABLE, LOCK_GROUPS, SUBCLASS_FETCH_MODE, VALIDATE_ALL, VALIDATE_NONE, VALIDATE_NORESOLVE, VALIDATE_RUNTIME, VALIDATE_UNENHANCED |
Method Summary | |
ClassIndicator |
getClassIndicator()
Return the class indicator for this class. |
int |
getClassIndicatorIndexed()
The value of the class indicator indexed extension. |
String |
getClassIndicatorName()
The value of the class indicator name extension. |
String |
getClassMappingName()
The value of the class mapping name extension. |
Object |
getDataStoreValue(Object obj,
Column[] cols)
Return the given column value(s) for the given object. |
DBDictionary |
getDBDictionary()
Return the dictionary that this mapping uses. |
FieldMapping |
getDeclaredFieldMapping(int index)
Convenience method to make casting from ClassMetaData.getDeclaredField(int)
unnecessary. |
FieldMapping |
getDeclaredFieldMapping(String name)
Convenience method to make casting from ClassMetaData.getDeclaredField(int)
unnecessary. |
FieldMapping[] |
getDeclaredFieldMappings()
Convenience method to make casting from ClassMetaData.getDeclaredFields()
unnecessary. |
FieldMapping[] |
getDefaultFetchGroupFieldMappings()
Convenience method to make casting from ClassMetaData.getDefaultFetchGroupFields() unnecessary. |
FieldMapping |
getEmbeddingMapping()
If this is an embedded mapping, return the owning field. |
FieldMapping |
getFieldMapping(FieldMetaData fmd)
Return the field mapping for the specified metadata. |
FieldMapping |
getFieldMapping(int index)
Convenience method to make casting from ClassMetaData.getField(int) unnecessary. |
FieldMapping |
getFieldMapping(String name)
Convenience method to make casting from ClassMetaData.getField(int) unnecessary. |
FieldMapping[] |
getFieldMappings()
Convenience method to make casting from ClassMetaData.getFields()
unnecessary. |
JoinableMapping |
getJoinableMapping(Column col)
Return the joinable mapping for the given column. |
FieldMapping[] |
getMappedFieldMappings()
Returns an array of all the field mappings mapped by this class. |
ClassMappingInfo |
getMappingInfo()
Return the mapping info that was used to create this mapping, if any. |
MappingRepository |
getMappingRepository()
Return the mapping repository for this mapping. |
ClassMetaData |
getMetaData()
Return the underlying class metadata. |
ClassMapping[] |
getNonVirtualMappings()
Returns the closest-derived list of non-virtual mappings for this mapping. |
ClassMapping |
getNonVirtualPCSuperclassMapping()
Return the nearest superclass mapping whose isVirtualMapping() method returns true
will be skipped. |
Object |
getObjectId(JDBCStoreManager store,
Result res,
ForeignKey fk,
Joins joins)
Return the oid value stored in the result. |
ClassMapping[] |
getPCSubclassMappings()
Return all the known subclass mappings for this mapping. |
ClassMapping |
getPCSuperclassMapping()
Convenience method to make casting from ClassMetaData.getPCSuperclassMetaData()
unnecessary. |
Column[] |
getPrimaryKeyColumns()
Return the columns this mapping uses to uniquely identify an object. |
FieldMapping[] |
getPrimaryKeyFieldMappings()
Convenience method to make casting from ClassMetaData.getPrimaryKeyFields()
unnecessary. |
int |
getRefDeleteAction()
The reference foreign key action. |
String |
getSequenceFactory()
The value of the sequence factory extension. |
SequenceFactory |
getSequenceFactoryInstance()
Return the sequence factory for this type, based on its sequence factory metadata extensions. |
VersionIndicator |
getVersionIndicator()
Return the version indicator for this class. |
int |
getVersionIndicatorIndexed()
The value of the version indicator indexed extension. |
String |
getVersionIndicatorName()
The value of the version indicator name extension. |
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 false if this mapping represents a table in the database. |
Joins |
joinSuperclass(Joins joins,
boolean toThis)
Join the mapping and its superclass. |
ResultObjectProvider |
load(JDBCStoreManager store,
boolean subclasses,
JDBCFetchConfiguration fetch,
long startIdx,
long endIdx)
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. |
void |
setAutoIncrement(boolean autoInc)
True if this class uses an auto-increment datastore primary key. |
void |
setAutoIncrementValue(KodoStateManager sm,
JDBCStoreManager store,
Column col,
Connection conn)
Set the next auto increment value for the given column into the given instance. |
void |
setClassIndicator(ClassIndicator cls)
Set the class indicator for this class. |
void |
setClassIndicatorIndexed(int idx)
The value of the class indicator indexed extension. |
void |
setClassIndicatorName(String ind)
The value of the class indicator name extension. |
void |
setClassMappingName(String map)
The value of the class mapping name extension. |
void |
setMappingInfo(ClassMappingInfo info)
Set the mapping info that was used to create this class. |
void |
setPCSuperclassMapping(ClassMapping superMapping)
Set the superclass mapping. |
void |
setRefDeleteAction(int action,
boolean deferred)
The reference foreign key action. |
void |
setRepository(JDOMetaDataRepository repos)
The supplied repository must be a MappingRepository . |
void |
setSequenceFactory(String plugin)
The value of the sequence factory extension. |
void |
setVersionIndicator(VersionIndicator version)
Set the version indicator for this class. |
void |
setVersionIndicatorIndexed(int idx)
The value of the version indicator indexed extension. |
void |
setVersionIndicatorName(String ind)
The value of the version indicator name extension. |
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. |
Methods inherited from interface java.lang.Comparable |
compareTo |
Methods inherited from interface com.solarmetric.meta.SourceTracker |
getTrackedResourceName |
Methods inherited from interface kodo.meta.Commentable |
getComments |
Methods inherited from interface kodo.jdbc.meta.Mapping |
addMappingInfoAttributes, delete, delete, fromMappingInfo, getMappingType, getTable, insert, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, refSchemaComponents, reverseMap, toMappingInfo, update, 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
public static final String SEQUENCE_NAME
public static final String CLASS_INDICATOR_VALUE
public static final String[] EXTENSION_KEYS
Method Detail |
public MappingRepository getMappingRepository()
getMappingRepository
in interface Mapping
public ClassMappingInfo getMappingInfo()
public void setMappingInfo(ClassMappingInfo info)
public ClassMapping[] getNonVirtualMappings()
isVirtualMapping()
returns
false, this method will simply return the current mapping.public VersionIndicator getVersionIndicator()
public void setVersionIndicator(VersionIndicator version)
public ClassIndicator getClassIndicator()
public void setClassIndicator(ClassIndicator cls)
public FieldMapping getEmbeddingMapping()
public JoinableMapping getJoinableMapping(Column col)
public Column[] getPrimaryKeyColumns()
public 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
columnspublic Object getObjectId(JDBCStoreManager store, Result res, ForeignKey fk, Joins joins) 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, JDBCStoreManager store, Column col, Connection conn) throws SQLException
public Object getDataStoreValue(Object obj, Column[] cols)
public Joins joinSuperclass(Joins joins, boolean toThis)
toThis
- if false, inner join to the superclass table; if
true, outer join from the superclass table to this
tablepublic ResultObjectProvider load(JDBCStoreManager store, boolean subclasses, JDBCFetchConfiguration fetch, long startIdx, long endIdx) throws SQLException
public boolean load(KodoStateManager sm, JDBCStoreManager store, JDOState state, JDBCFetchConfiguration fetch) throws SQLException, ClassNotFoundException
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 load(KodoStateManager,JDBCStoreManager,JDBCFetchConfiguration,Result)
.
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 ()), state);
, where the ImplHelper class is in the
kodo.util packagepublic boolean load(KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch, Result result) throws SQLException
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.
public boolean supportsEagerSelect(Select sel, KodoStateManager sm, ClassMapping base, JDBCStoreManager store, JDBCFetchConfiguration fetch)
base
mapping.
The given state manager may be null if selecting multiple instances.
By default, returns true.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 ClassMetaData getMetaData()
public void setRepository(JDOMetaDataRepository repos)
MappingRepository
.setRepository
in interface ClassMetaData
public ClassMapping getPCSuperclassMapping()
ClassMetaData.getPCSuperclassMetaData()
unnecessary.public ClassMapping getNonVirtualPCSuperclassMapping()
isVirtualMapping()
method returns true
will be skipped.public void setPCSuperclassMapping(ClassMapping superMapping)
ClassMappingInfo
s.public ClassMapping[] getPCSubclassMappings()
public FieldMapping[] getFieldMappings()
ClassMetaData.getFields()
unnecessary.public FieldMapping[] getDeclaredFieldMappings()
ClassMetaData.getDeclaredFields()
unnecessary.public FieldMapping[] getPrimaryKeyFieldMappings()
ClassMetaData.getPrimaryKeyFields()
unnecessary.public FieldMapping[] getMappedFieldMappings()
public FieldMapping[] getDefaultFetchGroupFieldMappings()
ClassMetaData.getDefaultFetchGroupFields()
unnecessary.public FieldMapping getFieldMapping(int index)
ClassMetaData.getField(int)
unnecessary.public FieldMapping getDeclaredFieldMapping(int index)
ClassMetaData.getDeclaredField(int)
unnecessary.public FieldMapping getFieldMapping(String name)
ClassMetaData.getField(int)
unnecessary.public FieldMapping getDeclaredFieldMapping(String name)
ClassMetaData.getDeclaredField(int)
unnecessary.public FieldMapping getFieldMapping(FieldMetaData fmd)
public boolean isVirtualMapping()
public DBDictionary getDBDictionary()
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |