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

## com.solarmetric.kodo.impl.jdbc.ormapping
Interface SubclassProvider

All Known Implementing Classes:
  SubclassProviderImpl

public interface SubclassProvider

This interface is responsible for storing subclass information into the database and for obtaining subclass information for data loaded from the database.

Method Summary
`void` | `addClassCondition(PersistenceManagerImpl pm, ObjectSelect sel)` Adds the appropriate SQL to `sel` to select only instances that are of the class that this subclass provider is configured for.
`void` | `addSubclassConditions(PersistenceManagerImpl pm, ObjectSelect sel)` Adds the appropriate SQL to `sel` to select only instances that are of the class that this provider is configured for, or are subclasses of that class.
`Column[]` | `getIndicatorColumns()` Returns the columns that store the indicator value.
`Class[]` | `getSubclasses(PersistenceManagerImpl pm)` Return a list of known persistent subclasses of the mapped type.
`Class` | `getType(PersistenceManagerImpl pm, ResultSet rs, int startIndex, ClassResolver resolver)` Return the class of the object stored in the current row of the given result set.
`Object` | `getValue(PersistenceManagerImpl pm)` Return an object to be stored in this mapping's indicator column.
`void` | `initialize(ClassMapping cm, Column[] indicatorCols)` Initialize this subclass provider for `cm`.
`void` | `initialize(ClassMapping cm, Table primaryTable)` Initialize this subclass provider for `cm`.
`void` | `insert(StateManagerImpl sm, Table currentTable, Insert insert)` Adds the appropriate SQL to `insert` to insert the subclass indicator values into `currentTable`.
`void` | `select(PersistenceManagerImpl pm, ObjectSelect sel)` Adds the appropriate SQL to `sel` to select the columns needed for subclass information.

Method Detail

### initialize

    public void initialize(ClassMapping cm,
                           Table primaryTable)

  Initialize this subclass provider for `cm`. `primaryTable` is the table that the class indicator should be installed in.

### initialize

    public void initialize(ClassMapping cm,
                           Column[] indicatorCols)

  Initialize this subclass provider for `cm`. `indicatorCols` is the array of indicator columns that `cm`'s parent class uses, and which this subclass provider should therefore use.

### getType

    public Class getType(PersistenceManagerImpl pm,
                         ResultSet rs,
                         int startIndex,
                         ClassResolver resolver)

  Return the class of the object stored in the current row of the given result set. `startIndex` is the index of the first of this subclass provider's columns.

### getValue

    public Object getValue(PersistenceManagerImpl pm)

  Return an object to be stored in this mapping's indicator column. `pm` is a reference to the PersistenceManagerImpl that requested that this class be loaded.

  This method should generate values from which can correctly determine a class.

### addClassCondition

    public void addClassCondition(PersistenceManagerImpl pm,
                                  ObjectSelect sel)

  Adds the appropriate SQL to `sel` to select only instances that are of the class that this subclass provider is configured for.

### addSubclassConditions

    public void addSubclassConditions(PersistenceManagerImpl pm,
                                      ObjectSelect sel)

  Adds the appropriate SQL to `sel` to select only instances that are of the class that this provider is configured for, or are subclasses of that class.

### select

    public void select(PersistenceManagerImpl pm,
                       ObjectSelect sel)

  Adds the appropriate SQL to `sel` to select the columns needed for subclass information.

### insert

    public void insert(StateManagerImpl sm,
                       Table currentTable,
                       Insert insert)

  Adds the appropriate SQL to `insert` to insert the subclass indicator values into `currentTable`.

### getIndicatorColumns

    public Column[] getIndicatorColumns()

  Returns the columns that store the indicator value. This may return `null` or `Column[0]` if there are no columns.

### getSubclasses

    public Class[] getSubclasses(PersistenceManagerImpl pm)

  Return a list of known persistent subclasses of the mapped type.

  Instantiates all the classes that are in the subclass field for this mapping. This will register the subclasses with the `JDOImplHelper`, which will then be accessible from the `ClassMapping#determineSubclassesFromJDOImplHelper`.

  This invokes `#getType(PersistenceManagerImpl,ClassResolver,Object)` on each distinct value for this mapping's subclass indicator column.

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

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