Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

## kodo.jdbc.meta
Class ColumnVersionIndicator

    java.lang.Object
      |
      +--kodo.jdbc.meta.Indicator
            |
            +--kodo.jdbc.meta.VersionIndicator
                  |
                  +--kodo.jdbc.meta.ColumnVersionIndicator

All Implemented Interfaces:
  Mapping

Direct Known Subclasses:
  DateVersionIndicator, NumberVersionIndicator

public abstract class ColumnVersionIndicator
extends VersionIndicator

Abstract base class for version indicators that use a column to hold version information.

Constructor Summary
`ColumnVersionIndicator()`

Method Summary
`Object` | `attachVersion(Serializable version)` Convert from an external form of the version into the internal form.
`protected void` | `change(KodoStateManager sm, RowManager rm, int action)` Issue either an update or delete.
`int` | `compareVersion(Object v1, Object v2)` We expect version objects that subclasses use will implement `Comparable`; simply use that mechanism for performing comparison.
`void` | `delete(KodoStateManager sm, RowManager rm)` Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates.
`Serializable` | `detachVersion(Object version)` Return a serializable, external form of the version.
`void` | `fromMappingInfo(MappingInfo info, boolean adapt)` Deserialize this mapping from a simple `MappingInfo` instance parsed from XML or some other format.
`Column` | `getColumn()` Return the column used to hold version info.
`protected abstract int` | `getDataStoreTypeCode()` Return the `FieldMapping` type code for the type of the column.
`protected int` | `getJDBCType()` Return the JDBC type of the column for this indicator.
`protected abstract Object` | `getNextVersion(Object currentVersion)` Return the next version object, given the current one (which may be null for newly-persisted objects).
`void` | `insert(KodoStateManager sm, RowManager rm)` Set values for the mapping into the proper rows.
`void` | `load(KodoStateManager sm, JDBCStoreManager store, Result res)` Load virtual row data.
`boolean` | `map()` Map a new instance of this mapping type.
`protected abstract boolean` | `needsRefresh(Object mem, Object db)` Return true if `mem` is not up-to-date with `db`.
`void` | `refSchemaComponents()` Increment the reference count of all used schema components.
`boolean` | `select(Select sel)` Select the virtual row columns of this mapping.
`void` | `setColumn(Column col)` Set the column used to hold version info.
`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, newInstance, postLoad, toString`

Methods inherited from class kodo.jdbc.meta.Indicator
`delete, getDBDictionary, getMappingRepository, getOwnerMapping, getTable, insert, isCustomDelete, isCustomInsert, isCustomUpdate, reverseMap, setOwnerMapping, update`

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

Methods inherited from interface kodo.jdbc.meta.Mapping
`getMappingType`

Constructor Detail

### ColumnVersionIndicator

    public ColumnVersionIndicator()

Method Detail

### getDataStoreTypeCode

    protected abstract int getDataStoreTypeCode()

  Return the `FieldMapping` type code for the type of the column.

### getJDBCType

    protected int getJDBCType()

  Return the JDBC type of the column for this indicator. Defaults to the preferred type for `getDataStoreTypeCode()`.

### getNextVersion

    protected abstract Object getNextVersion(Object currentVersion)

  Return the next version object, given the current one (which may be null for newly-persisted objects).

### needsRefresh

    protected abstract boolean needsRefresh(Object mem,
                                            Object db)

  Return true if `mem` is not up-to-date with `db`.

### compareVersion

    public int compareVersion(Object v1,
                              Object v2)

  We expect version objects that subclasses use will implement `Comparable`; simply use that mechanism for performing comparison.
  Overrides:
    `compareVersion` in class `VersionIndicator`
  Following copied from class: `kodo.jdbc.meta.VersionIndicator`
  See Also:
    `StoreManager.compareVersion(kodo.runtime.KodoStateManager, java.lang.Object, java.lang.Object)`

### getColumn

    public Column getColumn()

  Return the column used to hold version info.

### setColumn

    public void setColumn(Column col)

  Set the column used to hold version info.

### toMappingInfo

    public void toMappingInfo(MappingInfo info)

  Description copied from interface: `Mapping`
  Serialize this mapping to a simple `MappingInfo` instance for transfer to XML or some other format.

### fromMappingInfo

    public void fromMappingInfo(MappingInfo info,
                                boolean adapt)

  Description copied from interface: `Mapping`
  Deserialize this mapping from a simple `MappingInfo` instance parsed from XML or some other format. If the info is incompatible and `adapt` is true, try to adapt to the new info. This method must validate the given mapping information using the `SchemaGroup.findTable(kodo.jdbc.schema.Table)` method to find any needed tables, the `Table.getColumn(java.lang.String)` method to retrieve columns from those tables, and the `Column.isCompatible(int, int)` method to check all column types. This validation is important, as some schema groups use these methods to build themselves up dynamically rather than reading schema information from the database.
  Following copied from interface: `kodo.jdbc.meta.Mapping`
  Throws:
    `MappingInfoNotFoundException` - if the given info is invalid

### map

    public boolean map()

  Description copied from interface: `Mapping`
  Map a new instance of this mapping type. If the underlying metadata cannot be mapped using this type, return false.

### refSchemaComponents

    public void refSchemaComponents()

  Description copied from interface: `Mapping`
  Increment the reference count of all used schema components.
  Overrides:
    `refSchemaComponents` in class `Indicator`

### synchVersion

    public boolean synchVersion(KodoStateManager sm,
                                JDBCStoreManager store)
                         throws SQLException

  Description copied from class: `VersionIndicator`
  Synchronize the version of the given state manager with the version stored in memory.
  Overrides:
    `synchVersion` in class `VersionIndicator`
  Following copied from class: `kodo.jdbc.meta.VersionIndicator`
  See Also:
    `StoreManager.synchVersion(kodo.runtime.KodoStateManager, java.lang.Object)`

### select

    public boolean select(Select sel)

  Description copied from class: `Indicator`
  Select the virtual row columns of this mapping. Returns false by default.
  Overrides:
    `select` in class `Indicator`
  Following copied from class: `kodo.jdbc.meta.Indicator`
  Returns:
    true if anything was selected; false otherwise

### load

    public void load(KodoStateManager sm,
                     JDBCStoreManager store,
                     Result res)
              throws SQLException

  Description copied from class: `VersionIndicator`
  Load virtual row data.
  Overrides:
    `load` in class `VersionIndicator`

### insert

    public void insert(KodoStateManager sm,
                       RowManager rm)
                throws SQLException

  Description copied from interface: `Mapping`
  Set values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.
  Overrides:
    `insert` in class `Indicator`

### update

    public void update(KodoStateManager sm,
                       RowManager rm)
                throws SQLException

  Description copied from interface: `Mapping`
  Set values for the mapping into the proper rows.
  Overrides:
    `update` in class `Indicator`
  Following copied from interface: `kodo.jdbc.meta.Mapping`
  See Also:
    `Mapping.insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)`

### delete

    public void delete(KodoStateManager sm,
                       RowManager rm)
                throws SQLException

  Description copied from interface: `Mapping`
  Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. This allows foreign key analysis.
  Overrides:
    `delete` in class `Indicator`
  Following copied from interface: `kodo.jdbc.meta.Mapping`
  See Also:
    `Mapping.insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)`

### change

    protected void change(KodoStateManager sm,
                          RowManager rm,
                          int action)
                   throws SQLException

  Issue either an update or delete.

### detachVersion

    public Serializable detachVersion(Object version)

  Description copied from class: `VersionIndicator`
  Return a serializable, external form of the version.
  Overrides:
    `detachVersion` in class `VersionIndicator`

### attachVersion

    public Object attachVersion(Serializable version)

  Description copied from class: `VersionIndicator`
  Convert from an external form of the version into the internal form.
  Overrides:
    `attachVersion` in class `VersionIndicator`

Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.