Overview | Package | Class | Tree | Deprecated | Index | Help
| Kodo 4.1.0 generated on October 9 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.jdbc.meta.strats
Class LockGroupStateComparisonVersionStrategy

    java.lang.Object
      org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
          org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
              kodo.jdbc.meta.strats.LockGroupStateComparisonVersionStrategy

All Implemented Interfaces:
  org.apache.openjpa.jdbc.meta.Strategy, org.apache.openjpa.jdbc.meta.VersionStrategy

    public class LockGroupStateComparisonVersionStrategy

extends org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy

Uses a state image to determine whether concurrency violations take place.

Nested Class Summary
`static class` | `LockGroupStateComparisonVersionStrategy.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` | `ALIAS`

Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
`vers`

Constructor Summary
`LockGroupStateComparisonVersionStrategy()`

Method Summary
`void` | `afterLoad(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.jdbc.kernel.JDBCStore store)`
`boolean` | `checkVersion(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.jdbc.kernel.JDBCStore store, boolean updateVersion)`
`int` | `compareVersion(Object v1, Object v2)`
`void` | `customInsert(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.jdbc.kernel.JDBCStore store)` This method is for class mappings that take over the insert process, but still want to use this indicator for optimistic locking.
`LockGroupStateComparisonVersionStrategy.CustomUpdate` | `customUpdate(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.jdbc.kernel.JDBCStore store, org.apache.openjpa.jdbc.schema.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.
`String` | `getAlias()`
`void` | `insert(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.jdbc.kernel.JDBCStore store, org.apache.openjpa.jdbc.sql.RowManager rm)`
`void` | `map(boolean adapt)`
`void` | `update(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.jdbc.kernel.JDBCStore store, org.apache.openjpa.jdbc.sql.RowManager rm)`

Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy
`load, select, setVersion`

Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
`customDelete, customUpdate, delete, initialize, isCustomDelete, isCustomInsert, isCustomUpdate`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
`customDelete, customUpdate, delete, initialize, isCustomDelete, isCustomInsert, isCustomUpdate`

Field Detail

### ALIAS

    public static final String ALIAS

See Also:
  Constant Field Values

Constructor Detail

### LockGroupStateComparisonVersionStrategy

    public LockGroupStateComparisonVersionStrategy()

Method Detail

### getAlias

    public String getAlias()

  Specified by:
    `getAlias` in interface `org.apache.openjpa.jdbc.meta.Strategy`
  Overrides:
    `getAlias` in class `org.apache.openjpa.jdbc.meta.strats.AbstractStrategy`

### map

    public void map(boolean adapt)

  Specified by:
    `map` in interface `org.apache.openjpa.jdbc.meta.Strategy`
  Overrides:
    `map` in class `org.apache.openjpa.jdbc.meta.strats.AbstractStrategy`

### insert

    public void insert(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                       org.apache.openjpa.jdbc.kernel.JDBCStore store,
                       org.apache.openjpa.jdbc.sql.RowManager rm)
                throws SQLException

  Specified by:
    `insert` in interface `org.apache.openjpa.jdbc.meta.Strategy`
  Overrides:
    `insert` in class `org.apache.openjpa.jdbc.meta.strats.AbstractStrategy`
  Throws:
    `SQLException`

### customInsert

    public void customInsert(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                             org.apache.openjpa.jdbc.kernel.JDBCStore store)
                      throws SQLException

  This method is for class mappings that take over the insert process, but still want to use this indicator for optimistic locking.

  Specified by:
    `customInsert` in interface `org.apache.openjpa.jdbc.meta.Strategy`
  Overrides:
    `customInsert` in class `org.apache.openjpa.jdbc.meta.strats.AbstractStrategy`
  Throws:
    `SQLException`

### update

    public void update(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                       org.apache.openjpa.jdbc.kernel.JDBCStore store,
                       org.apache.openjpa.jdbc.sql.RowManager rm)
                throws SQLException

  Specified by:
    `update` in interface `org.apache.openjpa.jdbc.meta.Strategy`
  Overrides:
    `update` in class `org.apache.openjpa.jdbc.meta.strats.AbstractStrategy`
  Throws:
    `SQLException`

### customUpdate

    public LockGroupStateComparisonVersionStrategy.CustomUpdate customUpdate(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                                                                             org.apache.openjpa.jdbc.kernel.JDBCStore store,
                                                                             org.apache.openjpa.jdbc.schema.Table table,
                                                                             boolean record)
                                                                      throws SQLException

  This method is for class mappings that take over the update process, but still want to use this indicator for optimistic locking.

  Parameters:
    `sm` - the instance to test
    `store` - store manager context
    `table` - 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 tables
    `record` - set this parameter to true the last time you call this method, so the indicator can setup the next version of the given state manager
  Returns:
    a `LockGroupStateComparisonVersionStrategy.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 expression
  Throws:
    `SQLException`

### afterLoad

    public void afterLoad(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                          org.apache.openjpa.jdbc.kernel.JDBCStore store)

  Specified by:
    `afterLoad` in interface `org.apache.openjpa.jdbc.meta.VersionStrategy`
  Overrides:
    `afterLoad` in class `org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy`

### checkVersion

    public boolean checkVersion(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                                org.apache.openjpa.jdbc.kernel.JDBCStore store,
                                boolean updateVersion)
                         throws SQLException

  Specified by:
    `checkVersion` in interface `org.apache.openjpa.jdbc.meta.VersionStrategy`
  Overrides:
    `checkVersion` in class `org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy`
  Throws:
    `SQLException`

### compareVersion

    public int compareVersion(Object v1,
                              Object v2)

  Specified by:
    `compareVersion` in interface `org.apache.openjpa.jdbc.meta.VersionStrategy`
  Overrides:
    `compareVersion` in class `org.apache.openjpa.jdbc.meta.strats.AbstractVersionStrategy`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Kodo 4.1.0 generated on October 9 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.