SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.ormapping.Mapping
        |
        +--com.solarmetric.kodo.impl.jdbc.ormapping.FieldMapping
              |
              +--com.solarmetric.kodo.impl.jdbc.ormapping.AbstractCollectionMapping
Direct Known Subclasses:
CollectionMapping, ManyToManyMapping, OneToManyMapping

public abstract class AbstractCollectionMapping
extends FieldMapping

Represents a collection of values. Should be overridden by concrete Collection types.


Field Summary
static String REF_COL
          Metadata extension key used to mark the name of the reference column for this collection.
 
Fields inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.FieldMapping
COL_INDEX, COL_LENGTH, DATA_COL, EMPTY_COLUMNS
 
Fields inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.Mapping
_loc, _log, CUSTOM_MAPPING, dict, MAPPING, TABLE
 
Constructor Summary
AbstractCollectionMapping()
           
 
Method Summary
(package private)  void addValueMatchCondition(SQLStatement sql, Object value, ClassResolver resolver)
          Add a WHERE [data cols] = [value] for the given object value to the given sql statement.
 void appendIsEmpty(QuerySQLBuffer sql, Joins joins)
          Create a where clause to the given statement asking if this value is empty.
 void appendIsNotNull(QuerySQLBuffer sql, Joins joins)
          Add a where clause to the given statement asking if this value is not null.
 void appendIsNull(QuerySQLBuffer sql, Joins joins)
          Add a where clause to the given statement asking if this value is null.
(package private)  boolean canMap(FieldMetaData fmd, ClassResolver resolver)
          Return true if this mapping type can handle the given field, false otherwise.
 void compareToNull(ObjectSelect sel, boolean isNull)
          Compare this column to null.
 void delete(StateManagerImpl sm, Object[] pks, int field, SQLExecutionManager sqlem)
           
 Collection fromArray(Object array)
          Helper method to convert the given array to a collection.
(package private)  FieldMetaData getInverse(FieldMetaData fmd, ClassResolver resolver)
          Returns the metadata for the inverse extension of the given metadata, or null if it does not exist.
 Column[] getKeyColumns()
          Return the key columns of the mapping.
 Column[] getPKColumns()
          Return the primary key columns of the owning class.
 Column[] getRefColumns()
          Return the columns of the table this Collection is stored in which hold the PK values of the owning object.
(package private)  void insert(Insert insert, Object value, int index, StateManagerImpl sm, Object[] pks, int field)
          Prepare the insert for storage.
 void insert(StateManagerImpl sm, Object[] pks, int field, SQLExecutionManager sqlem)
           
(package private)  void install(FieldMetaData fmd, JDBCConfiguration conf, ClassResolver resolver, DBDictionary dict)
          Setup this FieldMapping using the given metadata.
 void join(Joins joins, PersistenceManagerImpl pm)
          Join this value to the class table.
 void joinKey(Joins join, PersistenceManagerImpl pms)
          Join the key value to the class table.
 void joinKeyRelation(Joins join, PersistenceManagerImpl pms)
          Join this value's table to the table for the related first class object key type, if any.
 void select(QuerySelect sel)
          Select this mapping.
 void setPKColumns(Column[] val)
          Set the primary key columns of the owning class.
 void setRefColumns(Column[] val)
          Set the columns of the table this Collection is stored in which hold the PK values of the owning object.
 Object toArray(Collection vals)
          Helper method to convert the given collection to an array of the proper component type.
 void update(StateManagerImpl sm, Object[] pks, int field, SQLExecutionManager sqlem)
           
 
Methods inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.FieldMapping
addColumn, addPKColumns, getDataColumns, getDataStoreValue, getInstance, getInstance, getKeyDataStoreValue, getMetaData, join, joinRelation, setDataColumns
 
Methods inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.Mapping
checkExtension, createMapping, createMapping, createMappings, createMappings, getClassName, getConfiguration, getDictionary, getFieldMapping, getInstance, getTable, install
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REF_COL

public static final String REF_COL
Metadata extension key used to mark the name of the reference column for this collection.
Constructor Detail

AbstractCollectionMapping

public AbstractCollectionMapping()
Method Detail

getRefColumns

public Column[] getRefColumns()
Return the columns of the table this Collection is stored in which hold the PK values of the owning object.

setRefColumns

public void setRefColumns(Column[] val)
Set the columns of the table this Collection is stored in which hold the PK values of the owning object.

getPKColumns

public Column[] getPKColumns()
Return the primary key columns of the owning class.

setPKColumns

public void setPKColumns(Column[] val)
Set the primary key columns of the owning class.

compareToNull

public void compareToNull(ObjectSelect sel,
                          boolean isNull)
Description copied from class: FieldMapping
Compare this column to null. For basic primary table mappings, the default definition of this method will suffice. More complex mappings should override this method.
Overrides:
compareToNull in class FieldMapping

insert

public void insert(StateManagerImpl sm,
                   Object[] pks,
                   int field,
                   SQLExecutionManager sqlem)
            throws SQLException

update

public void update(StateManagerImpl sm,
                   Object[] pks,
                   int field,
                   SQLExecutionManager sqlem)
            throws SQLException

delete

public void delete(StateManagerImpl sm,
                   Object[] pks,
                   int field,
                   SQLExecutionManager sqlem)
            throws SQLException

insert

void insert(Insert insert,
            Object value,
            int index,
            StateManagerImpl sm,
            Object[] pks,
            int field)
Prepare the insert for storage. Throws exception by default.

addValueMatchCondition

void addValueMatchCondition(SQLStatement sql,
                            Object value,
                            ClassResolver resolver)
Add a WHERE [data cols] = [value] for the given object value to the given sql statement.

getInverse

FieldMetaData getInverse(FieldMetaData fmd,
                         ClassResolver resolver)
Returns the metadata for the inverse extension of the given metadata, or null if it does not exist.

toArray

public Object toArray(Collection vals)
Helper method to convert the given collection to an array of the proper component type.

fromArray

public Collection fromArray(Object array)
Helper method to convert the given array to a collection.

canMap

boolean canMap(FieldMetaData fmd,
               ClassResolver resolver)
Description copied from class: FieldMapping
Return true if this mapping type can handle the given field, false otherwise. Note that this method cannot rely on the existance of other Mappings, as it is used in bootstrapping.
Overrides:
canMap in class FieldMapping

install

void install(FieldMetaData fmd,
             JDBCConfiguration conf,
             ClassResolver resolver,
             DBDictionary dict)
Description copied from class: FieldMapping
Setup this FieldMapping using the given metadata. Note that this method cannot rely on the existance of other Mappings, as it it is used in bootstrapping. This base implementation installs the proper extensions onto the metadata only; subclasses must override to properly map the type.
Overrides:
install in class FieldMapping

select

public void select(QuerySelect sel)
Description copied from class: FieldMapping
Select this mapping.
Overrides:
select in class FieldMapping

getKeyColumns

public Column[] getKeyColumns()
Description copied from class: FieldMapping
Return the key columns of the mapping.
Overrides:
getKeyColumns in class FieldMapping

appendIsEmpty

public void appendIsEmpty(QuerySQLBuffer sql,
                          Joins joins)
Description copied from class: FieldMapping
Create a where clause to the given statement asking if this value is empty.
Overrides:
appendIsEmpty in class FieldMapping

appendIsNull

public void appendIsNull(QuerySQLBuffer sql,
                         Joins joins)
Description copied from class: FieldMapping
Add a where clause to the given statement asking if this value is null.
Overrides:
appendIsNull in class FieldMapping

appendIsNotNull

public void appendIsNotNull(QuerySQLBuffer sql,
                            Joins joins)
Description copied from class: FieldMapping
Add a where clause to the given statement asking if this value is not null.
Overrides:
appendIsNotNull in class FieldMapping

join

public void join(Joins joins,
                 PersistenceManagerImpl pm)
Description copied from class: FieldMapping
Join this value to the class table.
Overrides:
join in class FieldMapping

joinKey

public void joinKey(Joins join,
                    PersistenceManagerImpl pms)
Description copied from class: FieldMapping
Join the key value to the class table.
Overrides:
joinKey in class FieldMapping

joinKeyRelation

public void joinKeyRelation(Joins join,
                            PersistenceManagerImpl pms)
Description copied from class: FieldMapping
Join this value's table to the table for the related first class object key type, if any.
Overrides:
joinKeyRelation in class FieldMapping

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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