Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.2.4 generated on January 7 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.runtime
Class InverseManager

    java.lang.Object
      |
      +--kodo.runtime.InverseManager

All Implemented Interfaces:
  Configurable

public class InverseManager
extends Object
implements Configurable

Class which manages inverse relations before flushing to the datastore. Ensures that inverse fields are set.

Currently limited to managing FCO and Collection-type relations.

Field Summary
`static int` | `ACTION_EXCEPTION` Constant representing the `ACTION_EXCEPTION` action
`static int` | `ACTION_MANAGE` Constant representing the `ACTION_MANAGE` action
`static int` | `ACTION_WARN` Constant representing the `ACTION_WARN` action
`protected static Object` | `NONE`

Constructor Summary
`InverseManager()`

Method Summary
`protected void` | `addToCollection(KodoStateManager sm, FieldMetaData fmd, Object val)` Add the given value to the collection at the selected field.
`protected void` | `clearInverseRelations(KodoPersistenceManagerSPI pm, KodoStateManager sm, FieldMetaData fmd, FieldMetaData[] inverses, Object newValue)` Remove all relations between the initial value of `fmd` for the instance managed by `sm` and its inverses.
`protected void` | `clearInverseRelations(KodoPersistenceManagerSPI pm, KodoStateManager sm, Object val, FieldMetaData fmd, FieldMetaData[] inverses)` Clear all inverse the relations from `val` to the instance managed by `sm`.
`void` | `correctRelations(KodoStateManager sm, FieldMetaData fmd, Object value)` Correct relations from the given dirty field to inverse instances.
`protected void` | `createInverseRelations(KodoPersistenceManagerSPI pm, Object fromRef, Object toRef, FieldMetaData fmd, FieldMetaData[] inverses)` Create the inverse relations for all the given inverse fields.
`void` | `endConfiguration()` Invoked upon completion of bean property configuration for this object.
`int` | `getAction()` Return the action constant to use during relationship checking.
`boolean` | `getManageLRS()` Return whether to manage LRS fields.
`protected void` | `removeFromCollection(KodoStateManager sm, FieldMetaData fmd, Object val)` Remove the given instance from the collection.
`void` | `setAction(int action)` Set the action constant to use during relationship checking.
`void` | `setAction(String action)` Set the action string to use during relationship checking.
`void` | `setConfiguration(Configuration conf)` Invoked prior to setting bean properties.
`void` | `setManageLRS(boolean manage)` Set whether to false LRS relations.
`void` | `startConfiguration()` Invoked before bean property configuration is begun on this object.
`protected void` | `storeField(KodoStateManager sm, FieldMetaData fmd, Object compare, Object val)` Store a given value at the given field.
`protected void` | `storeNull(KodoStateManager sm, FieldMetaData fmd, Object compare)` Store null value at the given field.
`protected void` | `throwException(KodoStateManager sm, FieldMetaData fmd)` Throw an inconsistency exception
`protected void` | `warnConsistency(KodoStateManager sm, FieldMetaData fmd)` Log an inconsistency warning

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

Field Detail

### NONE

    protected static final Object NONE

### ACTION_MANAGE

    public static final int ACTION_MANAGE

  Constant representing the `ACTION_MANAGE` action

### ACTION_WARN

    public static final int ACTION_WARN

  Constant representing the `ACTION_WARN` action

### ACTION_EXCEPTION

    public static final int ACTION_EXCEPTION

  Constant representing the `ACTION_EXCEPTION` action

Constructor Detail

### InverseManager

    public InverseManager()

Method Detail

### getManageLRS

    public boolean getManageLRS()

  Return whether to manage LRS fields.

### setManageLRS

    public void setManageLRS(boolean manage)

  Set whether to false LRS relations. Defaults to false.

### getAction

    public int getAction()

  Return the action constant to use during relationship checking. Defaults to `ACTION_MANAGE`.

### setAction

    public void setAction(int action)

  Set the action constant to use during relationship checking. Defaults to `ACTION_MANAGE`.

### setAction

    public void setAction(String action)

  Set the action string to use during relationship checking. Options include `manage, exception, warn`. This method is primarily for string-based automated configuration.

### startConfiguration

    public void startConfiguration()

  Description copied from interface: `Configurable`
  Invoked before bean property configuration is begun on this object.
  Specified by:
    `startConfiguration` in interface `Configurable`

### endConfiguration

    public void endConfiguration()

  Description copied from interface: `Configurable`
  Invoked upon completion of bean property configuration for this object.
  Specified by:
    `endConfiguration` in interface `Configurable`

### setConfiguration

    public void setConfiguration(Configuration conf)

  Description copied from interface: `Configurable`
  Invoked prior to setting bean properties.
  Specified by:
    `setConfiguration` in interface `Configurable`

### correctRelations

    public void correctRelations(KodoStateManager sm,
                                 FieldMetaData fmd,
                                 Object value)

  Correct relations from the given dirty field to inverse instances. Field `fmd` of the instance managed by `sm` has value `value`. Ensure that all inverses relations from `value` are consistent with this.

### createInverseRelations

    protected void createInverseRelations(KodoPersistenceManagerSPI pm,
                                          Object fromRef,
                                          Object toRef,
                                          FieldMetaData fmd,
                                          FieldMetaData[] inverses)

  Create the inverse relations for all the given inverse fields. A relation exists from `fromRef` to `toRef`; this method creates the inverses.

### clearInverseRelations

    protected void clearInverseRelations(KodoPersistenceManagerSPI pm,
                                         KodoStateManager sm,
                                         FieldMetaData fmd,
                                         FieldMetaData[] inverses,
                                         Object newValue)

  Remove all relations between the initial value of `fmd` for the instance managed by `sm` and its inverses. Relations shared with `newValue` can be left intact.

### clearInverseRelations

    protected void clearInverseRelations(KodoPersistenceManagerSPI pm,
                                         KodoStateManager sm,
                                         Object val,
                                         FieldMetaData fmd,
                                         FieldMetaData[] inverses)

  Clear all inverse the relations from `val` to the instance managed by `sm`.

### storeNull

    protected void storeNull(KodoStateManager sm,
                             FieldMetaData fmd,
                             Object compare)

  Store null value at the given field. Verify that the given compare value is the value being nulled. Pass NONE for no comparison.

### storeField

    protected void storeField(KodoStateManager sm,
                              FieldMetaData fmd,
                              Object compare,
                              Object val)

  Store a given value at the given field. Compare the given argument if not NONE.

### removeFromCollection

    protected void removeFromCollection(KodoStateManager sm,
                                        FieldMetaData fmd,
                                        Object val)

  Remove the given instance from the collection.

### addToCollection

    protected void addToCollection(KodoStateManager sm,
                                   FieldMetaData fmd,
                                   Object val)

  Add the given value to the collection at the selected field.

### warnConsistency

    protected void warnConsistency(KodoStateManager sm,
                                   FieldMetaData fmd)

  Log an inconsistency warning

### throwException

    protected void throwException(KodoStateManager sm,
                                  FieldMetaData fmd)

  Throw an inconsistency exception

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.2.4 generated on January 7 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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