|
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 |
java.lang.Object | +--kodo.jdbc.meta.Indicator | +--kodo.jdbc.meta.VersionIndicator | +--kodo.jdbc.meta.StateImageVersionIndicator
Bases versioning on the values of the object's persistent state. This indicator has the following limitations when determining whether an optimistic lock violation has occurred:
Inner Class Summary | |
class |
StateImageVersionIndicator.CustomUpdate
Row implementation we use to pass to versionable mappings so they can set up the where conditions we need to add to update statements. |
Field Summary | |
static String |
TYPE
|
Constructor Summary | |
StateImageVersionIndicator()
|
Method Summary | |
int |
compareVersion(Object v1,
Object v2)
Compare the two states. |
void |
customInsert(KodoStateManager sm)
This method is for class mappings that take over the insert process, but still want to use this indicator for optimistic locking. |
StateImageVersionIndicator.CustomUpdate |
customUpdate(KodoStateManager sm,
Table table,
boolean record)
This method is for class mappings that take over the update process, but still want to use this indicator for optimistic locking. |
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. |
String |
getMappingType()
Return the abbreviated name of this mapping, or the full class name if it is a custom mapping. |
Table |
getTable()
Return the mapping's primary data table. |
void |
insert(KodoStateManager sm,
RowManager rm)
Packages the version information based on the inserted state. |
boolean |
map()
Map a new instance of this mapping type. |
void |
postLoad(KodoStateManager sm,
JDBCStoreManager store)
This method is called after data is loaded into the instance, in case the version indicator works off of a state image. |
void |
reverseMap(SchemaGroup schema,
ReverseMappingTool tool)
Create mappings from the schema, using the given tool. |
boolean |
synchVersion(KodoStateManager sm,
JDBCStoreManager store)
Synchronize the version of the given state manager with the version stored in memory. |
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.VersionIndicator |
getDefaults, load, newInstance, toString |
Methods inherited from class kodo.jdbc.meta.Indicator |
addMappingInfoAttributes, delete, delete, getColumns, getDBDictionary, getMappingRepository, getOwnerMapping, insert, isCustomDelete, isCustomInsert, isCustomUpdate, refSchemaComponents, select, setOwnerMapping, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String TYPE
Constructor Detail |
public StateImageVersionIndicator()
Method Detail |
public String getMappingType()
Mapping
public Table getTable()
Mapping
getTable
in class Indicator
public void toMappingInfo(MappingInfo info)
Mapping
MappingInfo
instance
for transfer to XML or some other format.public void fromMappingInfo(MappingInfo info, boolean adapt)
Indicator
fromMappingInfo
in class Indicator
kodo.jdbc.meta.Indicator
Indicator.addMappingInfoAttributes(java.util.Collection)
public boolean map()
Mapping
public void reverseMap(SchemaGroup schema, ReverseMappingTool tool)
Mapping
reverseMap
in class Indicator
public int compareVersion(Object v1, Object v2)
StoreManager.VERSION_DIFFERENT
or
StoreManager.VERSION_SAME
.compareVersion
in class VersionIndicator
kodo.jdbc.meta.VersionIndicator
StoreManager.compareVersion(kodo.runtime.KodoStateManager, java.lang.Object, java.lang.Object)
public void insert(KodoStateManager sm, RowManager rm) throws SQLException
insert
in class Indicator
public void customInsert(KodoStateManager sm) throws SQLException
public void update(KodoStateManager sm, RowManager rm) throws SQLException
Mapping
update
in class Indicator
kodo.jdbc.meta.Mapping
Mapping.insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)
public StateImageVersionIndicator.CustomUpdate customUpdate(KodoStateManager sm, Table table, boolean record) throws SQLException
sm
- the instance to testtable
- only state image values in this table will be tested;
if the custom mapping uses different updates for
different tables, this method can be called multiple
times for the multiple tablesrecord
- set this parameter to true the last time you call
this method, so the indicator can setup the next
version of the given state managerStateImageVersionIndicator.CustomUpdate
whose getSQL method yields a
boolean SQL expression that tests whether the current
record is equal to our recorded state image, and whose
setParameters method parameterizes the given prepared
statement with the values used in the above boolean
expressionpublic void postLoad(KodoStateManager sm, JDBCStoreManager store)
VersionIndicator
postLoad
in class VersionIndicator
public boolean synchVersion(KodoStateManager sm, JDBCStoreManager store) throws SQLException
VersionIndicator
synchVersion
in class VersionIndicator
kodo.jdbc.meta.VersionIndicator
StoreManager.synchVersion(kodo.runtime.KodoStateManager, java.lang.Object)
|
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 |