|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.solarmetric.kodo.impl.jdbc.ormapping.Mapping
|
+--com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping
A mapping between a java class and its relational database representation.
| Field Summary | |
|---|---|
static String |
LOCK_COL
Metadata extension key used to mark the name of the optimistic lock column for this class. |
static String |
PK_COL
Metadata extension key used to mark the name of the primary key column for this class, if it uses data store identity. |
static String |
SUBCLASS_PROVIDER
Metadata extension key used to override the default subclass provider setting for this class. |
| Fields inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.Mapping |
|---|
CUSTOM_MAPPING, dict, MAPPING, TABLE |
| Constructor Summary | |
|---|---|
ClassMapping()
|
|
| Method Summary | |
|---|---|
protected void |
addSubclassConditions(PersistenceManagerImpl pm,
ObjectSelect sel,
FieldMetaData[] fmds,
boolean subs)
Adds to the where clause of the given query to only select the desired classes. |
protected void |
addTableJoins(PersistenceManager pm,
ObjectSelect sel)
Adds the appropriate join logic to join together multiple primary tables. |
boolean |
checkVersion(StateManagerImpl sm,
SQLExecutionManager sqlem)
Determine whether the given StateManager is the same version as the datastore version. |
void |
delete(StateManagerImpl sm,
SQLExecutionManager sqlem)
Deletes the given instance from the database. |
boolean |
exists(PersistenceManagerImpl pm,
Object oid,
SQLExecutionManager sqlem)
Verify that a given instance exists in the data store. |
Table |
getDefaultPrimaryTable()
Return the default primary table used by this class. |
static ClassMapping |
getInstance(ClassMetaData meta)
Return the ClassMapping for the given ClassMetaData instance, or null if none. |
Column |
getLockColumn()
Return the column used to track the optimistic lock version of the class. |
ClassMetaData |
getMetaData()
Return the ClassMetaData instance this mapping is installed on. |
Object |
getObjectId(PersistenceManagerImpl pm,
ResultSet rs,
int startIndex)
Return the object id for the object stored in the current row of the given result set. |
Column[] |
getPKColumns()
Return the primary key column(s) of the class' primary table. |
Column[] |
getPKColumns(Table t)
Return the primary key column(s) for a particular primary table. |
FieldMetaData[] |
getPrimaryMappingFields(PersistenceManagerImpl pm,
boolean subs,
ClassResolver resolver,
DBDictionary dict,
BitSet forcedFields,
BitSet excludedFields)
Returns an array of all FieldMetaData objects to load
when loading primary mappings for this class. |
protected List |
getPrimaryMappingFields(PersistenceManagerImpl pm,
FieldMetaData[] fmds,
Set tables,
BitSet forcedFields,
BitSet excludedFields)
Returns the primary table field meta datas from the given list that are either in the dfg or in the forcedFields
bit set. |
protected Table |
getPrimaryTable(FieldMetaData fmd)
Return the primary table used by this class for this field. |
Table[] |
getPrimaryTables()
|
Class[] |
getSubclasses()
|
protected Class[] |
getSubclassesDifferentMapping(ClassResolver resolver)
Return a list of known persistent subclasses of the mapped type that map to more tables than this mapping. |
protected Class[] |
getSubclassesSameMapping(ClassResolver resolver)
Return a list of known persistent subclasses of the mapped type that map to exactly the same set of tables as this mapping. |
SubclassProvider |
getSubclassProvider()
Return the SubclassProvider responsible for providing
subclass services for this mapping. |
void |
insert(StateManagerImpl sm,
SQLExecutionManager sqlem)
Inserts the given instance into the database. |
boolean |
loadByPK(StateManagerImpl sm,
com.solarmetric.kodo.runtime.JDOState state,
SQLExecutionManager sqlem,
BitSet fields,
boolean setVersion,
boolean forUpdate)
Load the object referenced by sm. |
void |
loadPrimaryMappings(StateManagerImpl sm,
ResultSet rs,
FieldMetaData[] fmds,
int startIndex,
com.solarmetric.kodo.runtime.JDOState state)
Load the primary mappings selected in the selectPrimaryMappings(com.solarmetric.kodo.runtime.PersistenceManagerImpl, com.solarmetric.kodo.impl.jdbc.sql.ObjectSelect, com.solarmetric.kodo.impl.jdbc.SQLExecutionManager, com.solarmetric.kodo.meta.FieldMetaData[], boolean) methods into the given StateManager. |
ExtentImpl |
newExtent(boolean subclasses,
JDBCStoreManager store)
Returns an ExtentImpl for the class managed by this
ClassMapping, optionally including subclasses. |
ResultSet |
selectPrimaryMappings(PersistenceManagerImpl pm,
ObjectSelect sel,
SQLExecutionManager sqlem,
FieldMetaData[] fmds,
boolean subs)
Loads the FieldData instances matching the given Select of the type mapped by this ClassMapping from the database. |
void |
setLockColumn(Column lock)
Set the column used to track the optimistic lock version of the class. |
void |
setPKColumns(Column[] pks)
Set the primary key column(s) of the class' primary table. |
void |
setPKColumns(Table t,
Column[] pks)
Set the primary key column(s) for the given primary table. |
protected void |
setSubclasses(Class[] subclasses)
Set the persistent subclasses of this type. |
void |
update(StateManagerImpl sm,
BitSet fields,
SQLExecutionManager sqlem)
Updates the given instance in the database. |
| Methods inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.Mapping |
|---|
createMappings, createMappings, getConfiguration, getDictionary, getInstance, getTable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String PK_COL
public static final String LOCK_COL
public static final String SUBCLASS_PROVIDER
| Constructor Detail |
public ClassMapping()
| Method Detail |
public static ClassMapping getInstance(ClassMetaData meta)
public ClassMetaData getMetaData()
public SubclassProvider getSubclassProvider()
SubclassProvider responsible for providing
subclass services for this mapping.public Column[] getPKColumns(Table t)
public void setPKColumns(Table t,
Column[] pks)
public Column[] getPKColumns()
public void setPKColumns(Column[] pks)
public Column getLockColumn()
public void setLockColumn(Column lock)
public Class[] getSubclasses()
protected Class[] getSubclassesSameMapping(ClassResolver resolver)
protected Class[] getSubclassesDifferentMapping(ClassResolver resolver)
protected void setSubclasses(Class[] subclasses)
protected Table getPrimaryTable(FieldMetaData fmd)
public Table[] getPrimaryTables()
public Table getDefaultPrimaryTable()
public void insert(StateManagerImpl sm,
SQLExecutionManager sqlem)
throws SQLException
sm - The StateManagerImpl to insert.sqlem - The SQLExecutionManager to use for
executing queries against the data store. For
optimal performance, the proprietary
SQLExecutionManager APIs should be
used to execute SQL statements, but it is also
possible to obtain the current Connection
from a SQLExecutionManager and use
regular JDBC APIs to perform the necessary work.
public void update(StateManagerImpl sm,
BitSet fields,
SQLExecutionManager sqlem)
throws SQLException
sm - The StateManagerImpl to update.fields - The fields that need to be stored.sqlem - The SQLExecutionManager to use for
executing queries against the data store. For
optimal performance, the proprietary
SQLExecutionManager APIs should be
used to execute SQL statements, but it is also
possible to obtain the current Connection
from a SQLExecutionManager and use
regular JDBC APIs to perform the necessary work.
public void delete(StateManagerImpl sm,
SQLExecutionManager sqlem)
throws SQLException
sm - The StateManagerImpl to delete.sqlem - The SQLExecutionManager to use for
executing queries against the data store. For
optimal performance, the proprietary
SQLExecutionManager APIs should be
used to execute SQL statements, but it is also
possible to obtain the current Connection
from a SQLExecutionManager and use
regular JDBC APIs to perform the necessary work.
public boolean exists(PersistenceManagerImpl pm,
Object oid,
SQLExecutionManager sqlem)
throws SQLException
pm - The PersistenceManagerImpl that caused this
method invocation to be made.oid - The ID of the object to look for in the data store.sqlem - The SQLExecutionManager to use for
executing queries against the data store. For
optimal performance, the proprietary
SQLExecutionManager APIs should be
used to execute SQL statements, but it is also
possible to obtain the current Connection
from a SQLExecutionManager and use
regular JDBC APIs to perform the necessary work.true if the data exists; else false.
public boolean checkVersion(StateManagerImpl sm,
SQLExecutionManager sqlem)
throws SQLException
sm - the instance for which a version check should be
performed.sqlem - The SQLExecutionManager to use for
executing queries against the data store. For
optimal performance, the proprietary
SQLExecutionManager APIs should be
used to execute SQL statements, but it is also
possible to obtain the current Connection
from a SQLExecutionManager and use
regular JDBC APIs to perform the necessary work.
public Object getObjectId(PersistenceManagerImpl pm,
ResultSet rs,
int startIndex)
throws SQLException
store - the JDBCStoreManager making the request
for PK values.rs - the ResultSet produced by the
selectPrimaryMappings(com.solarmetric.kodo.runtime.PersistenceManagerImpl, com.solarmetric.kodo.impl.jdbc.sql.ObjectSelect, com.solarmetric.kodo.impl.jdbc.SQLExecutionManager, com.solarmetric.kodo.meta.FieldMetaData[], boolean) methodstartIndex - the column index that represents the beginning
of the SELECTs made in the
selectPrimaryMappings(com.solarmetric.kodo.runtime.PersistenceManagerImpl, com.solarmetric.kodo.impl.jdbc.sql.ObjectSelect, com.solarmetric.kodo.impl.jdbc.SQLExecutionManager, com.solarmetric.kodo.meta.FieldMetaData[], boolean) method
public boolean loadByPK(StateManagerImpl sm,
com.solarmetric.kodo.runtime.JDOState state,
SQLExecutionManager sqlem,
BitSet fields,
boolean setVersion,
boolean forUpdate)
throws SQLException
sm.sm - The StateManagerImpl of the data to load.
sm.oid contains the object ID of the
data.state - The JDOState that sm should
be initialized to. This can be null
if no initialization should be performed on
sm. If non-null, then
StateManagerImpl.initialize(javax.jdo.spi.PersistenceCapable, com.solarmetric.kodo.runtime.JDOState) should be
invoked on sm.sqlem - The SQLExecutionManager to use for
executing queries against the data store. For
optimal performance, the proprietary
SQLExecutionManager APIs should be
used to execute SQL statements, but it is also
possible to obtain the current Connection
from a SQLExecutionManager and use
regular JDBC APIs to perform the necessary work.fields - A BitSet indicating which fields must
be loaded. It is legal to load more than just
these fields, but at least these must be loaded.forUpdate - If this is true, then the SELECT
statement created should request a lock on the
selected data.
public ExtentImpl newExtent(boolean subclasses,
JDBCStoreManager store)
ExtentImpl for the class managed by this
ClassMapping, optionally including subclasses.subclasses - If true, the created extent should
be capable of accessing all subclasses of the
class managed by this ClassMapping.
Otherwise, the created extent should only provide
access to the exact managed class.store - The JDBCStoreManager that made the
request for the extent.
public void loadPrimaryMappings(StateManagerImpl sm,
ResultSet rs,
FieldMetaData[] fmds,
int startIndex,
com.solarmetric.kodo.runtime.JDOState state)
throws SQLException
selectPrimaryMappings(com.solarmetric.kodo.runtime.PersistenceManagerImpl, com.solarmetric.kodo.impl.jdbc.sql.ObjectSelect, com.solarmetric.kodo.impl.jdbc.SQLExecutionManager, com.solarmetric.kodo.meta.FieldMetaData[], boolean) methods into the given StateManager.rs - the ResultSet produced by the
selectPrimaryMappings(com.solarmetric.kodo.runtime.PersistenceManagerImpl, com.solarmetric.kodo.impl.jdbc.sql.ObjectSelect, com.solarmetric.kodo.impl.jdbc.SQLExecutionManager, com.solarmetric.kodo.meta.FieldMetaData[], boolean) methodstartIndex - the column index that represents the beginning
of the SELECTs made in the
selectPrimaryMappings(com.solarmetric.kodo.runtime.PersistenceManagerImpl, com.solarmetric.kodo.impl.jdbc.sql.ObjectSelect, com.solarmetric.kodo.impl.jdbc.SQLExecutionManager, com.solarmetric.kodo.meta.FieldMetaData[], boolean) methodstate - The JDOState that sm should be
initialized to. Should be null
if no initialization should happen.
public FieldMetaData[] getPrimaryMappingFields(PersistenceManagerImpl pm,
boolean subs,
ClassResolver resolver,
DBDictionary dict,
BitSet forcedFields,
BitSet excludedFields)
FieldMetaData objects to load
when loading primary mappings for this class.
protected List getPrimaryMappingFields(PersistenceManagerImpl pm,
FieldMetaData[] fmds,
Set tables,
BitSet forcedFields,
BitSet excludedFields)
forcedFields
bit set.
public ResultSet selectPrimaryMappings(PersistenceManagerImpl pm,
ObjectSelect sel,
SQLExecutionManager sqlem,
FieldMetaData[] fmds,
boolean subs)
throws SQLException
protected void addSubclassConditions(PersistenceManagerImpl pm,
ObjectSelect sel,
FieldMetaData[] fmds,
boolean subs)
protected void addTableJoins(PersistenceManager pm,
ObjectSelect sel)
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||