SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.impl.jdbc.ormapping
Class SubclassProviderImpl

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl
All Implemented Interfaces:
SubclassProvider
Direct Known Subclasses:
IntegerSubclassProvider

public class SubclassProviderImpl
extends Object
implements SubclassProvider


Field Summary
static String CLASS_COL
          Metadata extension key used to mark the name of the subclass indicator column for this class.
 
Constructor Summary
SubclassProviderImpl()
           
 
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 addClassCondition(PersistenceManagerImpl pm, QuerySelect 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.
 void addSubclassConditions(PersistenceManagerImpl pm, QuerySelect 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.
protected  String getIndicatorColumnName()
          Returns the name of the subclass indicator column used by this mapping/provider combination.
 Column[] getIndicatorColumns()
          Returns the columns that store the indicator value.
protected  int getIndicatorColumnSQLType()
          Returns the SQLTypes type constant for the indicator column used by this mapping/provider combination.
 Class[] getSubclasses(PersistenceManagerImpl pm)
          This invokes getType(PersistenceManagerImpl,ClassResolver,Object) on each distinct value for this mapping's subclass indicator column.
 Class getType(PersistenceManagerImpl pm, ClassResolver resolver, Object indicatorVal)
          Return a Class object given that val was stored in this mapping's indicator column.
 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[] cols)
          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.
 void select(PersistenceManagerImpl pm, QuerySelect sel)
          Adds the appropriate SQL to sel to select the columns needed for subclass information.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_COL

public static final String CLASS_COL
Metadata extension key used to mark the name of the subclass indicator column for this class.
Constructor Detail

SubclassProviderImpl

public SubclassProviderImpl()
Method Detail

initialize

public void initialize(ClassMapping cm,
                       Table primaryTable)
Description copied from interface: SubclassProvider
Initialize this subclass provider for cm. primaryTable is the table that the class indicator should be installed in.
Specified by:
initialize in interface SubclassProvider

initialize

public void initialize(ClassMapping cm,
                       Column[] cols)
Description copied from interface: SubclassProvider
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.
Specified by:
initialize in interface SubclassProvider

getType

public Class getType(PersistenceManagerImpl pm,
                     ResultSet rs,
                     int startIndex,
                     ClassResolver resolver)
Description copied from interface: SubclassProvider

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.

Specified by:
getType in interface SubclassProvider

getType

public Class getType(PersistenceManagerImpl pm,
                     ClassResolver resolver,
                     Object indicatorVal)
Return a Class object given that val was stored in this mapping's indicator column. The class should be loaded with resolver. pm is a reference to the PersistenceManagerImpl that requested that this class be loaded.

getValue

public Object getValue(PersistenceManagerImpl pm)
Description copied from interface: SubclassProvider

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 SubclassProvider.getType(PersistenceManagerImpl,ResultSet,int,ClassResolver) can correctly determine a class.

Specified by:
getValue in interface SubclassProvider

addClassCondition

public void addClassCondition(PersistenceManagerImpl pm,
                              ObjectSelect sel)
Description copied from interface: SubclassProvider
Adds the appropriate SQL to sel to select only instances that are of the class that this subclass provider is configured for.
Specified by:
addClassCondition in interface SubclassProvider

addSubclassConditions

public void addSubclassConditions(PersistenceManagerImpl pm,
                                  ObjectSelect sel)
Description copied from interface: SubclassProvider
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.
Specified by:
addSubclassConditions in interface SubclassProvider

select

public void select(PersistenceManagerImpl pm,
                   ObjectSelect sel)
Description copied from interface: SubclassProvider
Adds the appropriate SQL to sel to select the columns needed for subclass information.
Specified by:
select in interface SubclassProvider

insert

public void insert(StateManagerImpl sm,
                   Table currentTable,
                   Insert insert)
Description copied from interface: SubclassProvider
Adds the appropriate SQL to insert to insert the subclass indicator values into currentTable.
Specified by:
insert in interface SubclassProvider

getIndicatorColumns

public Column[] getIndicatorColumns()
Description copied from interface: SubclassProvider
Returns the columns that store the indicator value. This may return null or Column[0] if there are no columns.
Specified by:
getIndicatorColumns in interface SubclassProvider

getIndicatorColumnName

protected String getIndicatorColumnName()
Returns the name of the subclass indicator column used by this mapping/provider combination.

getIndicatorColumnSQLType

protected int getIndicatorColumnSQLType()
Returns the SQLTypes type constant for the indicator column used by this mapping/provider combination.

getSubclasses

public Class[] getSubclasses(PersistenceManagerImpl pm)

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

Specified by:
getSubclasses in interface SubclassProvider

addClassCondition

public void addClassCondition(PersistenceManagerImpl pm,
                              QuerySelect sel)
Description copied from interface: SubclassProvider
Adds the appropriate SQL to sel to select only instances that are of the class that this subclass provider is configured for.
Specified by:
addClassCondition in interface SubclassProvider

addSubclassConditions

public void addSubclassConditions(PersistenceManagerImpl pm,
                                  QuerySelect sel)
Description copied from interface: SubclassProvider
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.
Specified by:
addSubclassConditions in interface SubclassProvider

select

public void select(PersistenceManagerImpl pm,
                   QuerySelect sel)
Description copied from interface: SubclassProvider
Adds the appropriate SQL to sel to select the columns needed for subclass information.
Specified by:
select in interface SubclassProvider

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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