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.jdbc.meta
Class AbstractCollectionFieldMapping

    java.lang.Object
      |
      +--kodo.meta.DelegatingExtensions
            |
            +--kodo.meta.DelegatingFieldMetaData
                  |
                  +--kodo.jdbc.meta.AbstractFieldMapping
                        |
                        +--kodo.jdbc.meta.ReferenceFieldMapping
                              |
                              +--kodo.jdbc.meta.ContainerFieldMapping
                                    |
                                    +--kodo.jdbc.meta.AbstractCollectionFieldMapping

All Implemented Interfaces:
  Comparable, Extensions, FieldMapping, FieldMetaData, JDBCTypes, JDOTypes, Mapping

Direct Known Subclasses:
  ColumnCollectionFieldMapping, ManyToManyFieldMapping, OneToManyFieldMapping

public abstract class AbstractCollectionFieldMapping
extends ContainerFieldMapping

Base class for collection mappings. Manages ordering and basic query functionality as well as lazy loading. Subclasses must implement `FieldMapping.loadProjection(kodo.jdbc.runtime.JDBCStoreManager, kodo.jdbc.runtime.JDBCFetchConfiguration, kodo.jdbc.sql.Result, kodo.jdbc.sql.Joins)` even if they have FCO elements.

Inner Class Summary
`protected class` | `AbstractCollectionFieldMapping.LRSProxyCollection` Large result set collection.

Field Summary
`static String` | `ORDERED` Extension key used to mark whether a collection/array mapping should use an extra column to maintain order.

Fields inherited from class kodo.jdbc.meta.ContainerFieldMapping
`CONTAINER_META`

Fields inherited from interface kodo.jdbc.meta.JDBCTypes
`TYPE_ASCII_STREAM, TYPE_BINARY_STREAM, TYPE_BLOB, TYPE_BYTES, TYPE_CHAR_STREAM, TYPE_CLOB, TYPE_JDBC_DEFAULT, TYPE_REF, TYPE_SQL_ARRAY, TYPE_SQL_DATE, TYPE_SQL_OBJECT, TYPE_TIME, TYPE_TIMESTAMP`

Fields inherited from interface kodo.meta.JDOTypes
`TYPE_ARRAY, TYPE_BIGDECIMAL, TYPE_BIGINTEGER, TYPE_BOOLEAN, TYPE_BOOLEAN_OBJ, TYPE_BYTE, TYPE_BYTE_OBJ, TYPE_CHAR, TYPE_CHAR_OBJ, TYPE_COLLECTION, TYPE_DATE, TYPE_DOUBLE, TYPE_DOUBLE_OBJ, TYPE_FCO, TYPE_FLOAT, TYPE_FLOAT_OBJ, TYPE_INT, TYPE_INT_OBJ, TYPE_LOCALE, TYPE_LONG, TYPE_LONG_OBJ, TYPE_MAP, TYPE_NUMBER, TYPE_OBJECT, TYPE_PC_OBJECT, TYPE_SHORT, TYPE_SHORT_OBJ, TYPE_STRING`

Fields inherited from interface kodo.jdbc.meta.FieldMapping
`AUTO_INCREMENT, DELETE_ACTION, ELEMENT_DELETE_ACTION, ELEMENT_INDEXED, ELEMENT_SIZE, EXTENSION_KEYS, FIELD_MAP, INDEXED, KEY_DELETE_ACTION, KEY_INDEXED, KEY_SIZE, REF_DELETE_ACTION, REF_INDEXED, SIZE, VALUE_DELETE_ACTION, VALUE_INDEXED, VALUE_SIZE`

Fields inherited from interface kodo.meta.FieldMetaData
`DEPENDENT, EAGER_FETCH_MODE, ELEMENT_DEPENDENT, ELEMENT_TYPE, EXTERNAL_VALUES, EXTERNALIZER, FACTORY, FETCH_GROUP, INVERSE_LOGICAL, INVERSE_OWNER, KEY_DEPENDENT, KEY_TYPE, LOCK_GROUP, LOCK_GROUP_DEFAULT, LOCK_GROUP_NONE, LRS, MANAGE_NONE, MANAGE_PERSISTENT, MANAGE_TRANSACTIONAL, NULL_DEFAULT, NULL_EXCEPTION, NULL_NONE, NULL_UNSET, TYPE, VALUE_DEPENDENT, VALUE_TYPE`

Constructor Summary
`AbstractCollectionFieldMapping(FieldMetaData meta)` Constructor.

Method Summary
`void` | `addExtensionKeys(Collection attrs)` Add all the known extension keys to the specified collection; any implementation that utilized new extensions should override this method to include both the known extensions of its superclass as well as its own extension keys.
`void` | `addMappingInfoAttributes(Collection attrs)` Add all mapping attributes names used by this mapping to the given collection.
`protected void` | `fromMappingInfo(MappingInfo info, boolean adapt, boolean canOrder)`
`Column` | `getOrderColumn()` Return the column holding the ordering data.
`int` | `getOrdered()`
`boolean` | `isEagerJoinToMany()` Whether the eager joins used by this field are to-many.
`void` | `load(KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch)` Load secondary data using a connection from the store manager.
`void` | `loadEagerJoin(KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch, Result res)` Load the joined eager result.
`void` | `loadEagerParallel(KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch, Result res, Result orig)` Load the batched eager result.
`protected boolean` | `map(Table table, boolean defaultOrder)`
`void` | `refSchemaComponents()` Increment the reference count of all used schema components.
`int` | `selectEagerJoin(Select sel, KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch, int eagerMode)` Use eager joins to select related objects.
`int` | `selectEagerParallel(Select sel, Select orig, KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch, int eagerMode)` Create a parallel eager select for related objects.
`protected abstract void` | `selectProjection(Select sel, JDBCStoreManager store, JDBCFetchConfiguration fetch, int eagerMode, Joins joins)` Implement this method to select the projection of this field.
`void` | `setOrderColumn(Column col)` Set the column holding the ordering data.
`void` | `setOrdered(int ordered)`
`boolean` | `supportsSelect(Select sel, int type, KodoStateManager sm, JDBCStoreManager store, JDBCFetchConfiguration fetch)` Return true if this mapping can perform the given select type.
`protected Object` | `toArray(Collection coll)` Helper method to return the given collection as an array.
`protected Collection` | `toCollection(Object array)` Helper method to return the given array as a collection.
`void` | `toMappingInfo(MappingInfo info)` Serialize this mapping to a simple `MappingInfo` instance for transfer to XML or some other format.

Methods inherited from class kodo.jdbc.meta.ContainerFieldMapping
`appendIsEmpty, appendIsNotNull, appendIsNull, delete, fromMappingInfo, getContainerMeta, getMetaDataColumn, insert, join, load, map, nullEmbedded, select, setContainerMeta, setMetaDataColumn, update`

Methods inherited from class kodo.jdbc.meta.ReferenceFieldMapping
`createRefForeignKey, getJoinedRow, getRefForeignKey, getRefJoins, getRefJoinType, getTable, join, setRefForeignKey, setRefForeignKey, setRefJoinType, wherePrimaryKey, whereRefForeignKey`

Methods inherited from class kodo.jdbc.meta.AbstractFieldMapping
`assertTable, delete, deleteEmbedded, deleteEmbedded, getDataStoreValue, getDBDictionary, getDeclaredElementTypeMapping, getDeclaredElementTypeMetaData, getDeclaredKeyTypeMapping, getDeclaredKeyTypeMetaData, getDeclaredTypeMapping, getDeclaredTypeMetaData, getDeleteAction, getElementDeleteAction, getElementIndexed, getElementSize, getElementTypeMapping, getElementTypeMetaData, getFieldMappingName, getIndexed, getInverseMappings, getInverseMetaDatas, getInverseOwnerMapping, getInverseOwnerMetaData, getKeyColumns, getKeyDataStoreValue, getKeyDeleteAction, getKeyIndexed, getKeySize, getKeyTypeMapping, getKeyTypeMetaData, getMappingRepository, getMetaData, getNonVirtualOwner, getOwner, getOwnerMapping, getOwnerTable, getRefDeleteAction, getRefIndexed, getSize, getTypeMapping, getTypeMetaData, insert, invalidateResolve, isAutoIncrement, isCustomDelete, isCustomDeleteEmbedded, isCustomInsert, isCustomNullEmbedded, isCustomUpdate, isDeleteActionDeferred, isElementDeleteActionDeferred, isKeyDeleteActionDeferred, isPCObjectRelation, isRefDeleteActionDeferred, isResolved, joinKey, joinKeyRelation, joinRelation, loadKeyProjection, nullEmbedded, resolve, reverseMap, setAutoIncrement, setDeleteAction, setElementDeleteAction, setElementIndexed, setElementSize, setFieldMappingName, setIndexed, setKeyDeleteAction, setKeyIndexed, setKeySize, setNonVirtualOwner, setOwner, setRefDeleteAction, setRefIndexed, setSize, update`

Methods inherited from class kodo.meta.DelegatingFieldMetaData
`compareTo, equals, getComparator, getDeclaredElementType, getDeclaredElementTypeCode, getDeclaredIndex, getDeclaredKeyType, getDeclaredKeyTypeCode, getDeclaredPrimaryKeyIndex, getDeclaredType, getDeclaredTypeCode, getDelegate, getEagerFetchMode, getElementType, getElementTypeCode, getElementTypeName, getExternalizer, getExternalValue, getExternalValues, getFactory, getFetchGroup, getFieldFlag, getFieldValue, getFullName, getIndex, getInnermostDelegate, getInverseLogical, getInverseOwner, getKeyType, getKeyTypeCode, getKeyTypeName, getLockGroup, getManagement, getName, getNullValue, getPrimaryKeyIndex, getProxyType, getType, getTypeCode, getTypeName, hashCode, isDefaultFetchGroupExplicit, isDependent, isElementDependent, isElementEmbedded, isEmbedded, isExplicit, isExternalized, isInDefaultFetchGroup, isKeyDependent, isKeyEmbedded, isLRS, isPrimaryKey, isTransient, setComparator, setDeclaredElementType, setDeclaredElementTypeCode, setDeclaredIndex, setDeclaredKeyType, setDeclaredKeyTypeCode, setDeclaredPrimaryKeyIndex, setDeclaredType, setDeclaredTypeCode, setDependent, setEagerFetchMode, setElementDependent, setElementEmbedded, setElementTypeName, setEmbedded, setExplicit, setExternalizer, setExternalValues, setFactory, setFetchGroup, setInDefaultFetchGroup, setIndex, setInverseLogical, setInverseOwner, setKeyDependent, setKeyEmbedded, setKeyTypeName, setLockGroup, setLRS, setManagement, setName, setNullValue, setPrimaryKey, setProxyType, setTransient, setTypeName, toString`

Methods inherited from class kodo.meta.DelegatingExtensions
`addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension`

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

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

Methods inherited from interface kodo.jdbc.meta.FieldMapping
`getColumns, loadProjection`

Methods inherited from interface kodo.meta.FieldMetaData
`getComparator, getDeclaredElementType, getDeclaredElementTypeCode, getDeclaredIndex, getDeclaredKeyType, getDeclaredKeyTypeCode, getDeclaredPrimaryKeyIndex, getDeclaredType, getDeclaredTypeCode, getEagerFetchMode, getElementType, getElementTypeCode, getElementTypeName, getExternalizer, getExternalValue, getExternalValues, getFactory, getFetchGroup, getFieldFlag, getFieldValue, getFullName, getIndex, getInverseLogical, getInverseOwner, getKeyType, getKeyTypeCode, getKeyTypeName, getLockGroup, getManagement, getName, getNullValue, getPrimaryKeyIndex, getProxyType, getType, getTypeCode, getTypeName, isDefaultFetchGroupExplicit, isDependent, isElementDependent, isElementEmbedded, isEmbedded, isExplicit, isExternalized, isInDefaultFetchGroup, isKeyDependent, isKeyEmbedded, isLRS, isPrimaryKey, isTransient, setComparator, setDeclaredElementType, setDeclaredElementTypeCode, setDeclaredIndex, setDeclaredKeyType, setDeclaredKeyTypeCode, setDeclaredPrimaryKeyIndex, setDeclaredType, setDeclaredTypeCode, setDependent, setEagerFetchMode, setElementDependent, setElementEmbedded, setElementTypeName, setEmbedded, setExplicit, setExternalizer, setExternalValues, setFactory, setFetchGroup, setInDefaultFetchGroup, setIndex, setInverseLogical, setInverseOwner, setKeyDependent, setKeyEmbedded, setKeyTypeName, setLockGroup, setLRS, setManagement, setName, setNullValue, setPrimaryKey, setProxyType, setTransient, setTypeName`

Methods inherited from interface kodo.meta.Extensions
`addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension`

Methods inherited from interface java.lang.Comparable
`compareTo`

Field Detail

### ORDERED

    public static final String ORDERED

  Extension key used to mark whether a collection/array mapping should use an extra column to maintain order. The default is true for fields declared as array or list types, and false otherwise. Note that only the owner of a field can maintain ordering on it, so inverses in two-sided relations and 1-many relation't can't be ordered. Legal values are `true` and `false`.

Constructor Detail

### AbstractCollectionFieldMapping

    public AbstractCollectionFieldMapping(FieldMetaData meta)

  Constructor. Supply underlying metadata.

Method Detail

### getOrderColumn

    public Column getOrderColumn()

  Return the column holding the ordering data.

### setOrderColumn

    public void setOrderColumn(Column col)

  Set the column holding the ordering data.

### getOrdered

    public int getOrdered()

### setOrdered

    public void setOrdered(int ordered)

### 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.
  Overrides:
    `toMappingInfo` in class `ContainerFieldMapping`

### fromMappingInfo

    protected void fromMappingInfo(MappingInfo info,
                                   boolean adapt,
                                   boolean canOrder)

  Overrides:
    `fromMappingInfo` in class `ReferenceFieldMapping`

### addMappingInfoAttributes

    public void addMappingInfoAttributes(Collection attrs)

  Description copied from interface: `Mapping`
  Add all mapping attributes names used by this mapping to the given collection. For foreign key attributes, add the prefix.
  Overrides:
    `addMappingInfoAttributes` in class `ContainerFieldMapping`

### addExtensionKeys

    public void addExtensionKeys(Collection attrs)

  Description copied from interface: `Extensions`
  Add all the known extension keys to the specified collection; any implementation that utilized new extensions should override this method to include both the known extensions of its superclass as well as its own extension keys.
  Overrides:
    `addExtensionKeys` in class `ContainerFieldMapping`

### map

    protected boolean map(Table table,
                          boolean defaultOrder)

### refSchemaComponents

    public void refSchemaComponents()

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

### selectProjection

    protected abstract void selectProjection(Select sel,
                                             JDBCStoreManager store,
                                             JDBCFetchConfiguration fetch,
                                             int eagerMode,
                                             Joins joins)

  Implement this method to select the projection of this field. Elements of the result will be loaded with `FieldMapping.loadProjection(kodo.jdbc.runtime.JDBCStoreManager, kodo.jdbc.runtime.JDBCFetchConfiguration, kodo.jdbc.sql.Result, kodo.jdbc.sql.Joins)`.

### supportsSelect

    public boolean supportsSelect(Select sel,
                                  int type,
                                  KodoStateManager sm,
                                  JDBCStoreManager store,
                                  JDBCFetchConfiguration fetch)

  Description copied from interface: `FieldMapping`
  Return true if this mapping can perform the given select type. By default, returns true only if the type is `Select#JOINLESS` and the given select instance already has this field's table selected. The given state manager may be null if selecting multiple instances.
  Overrides:
    `supportsSelect` in class `ContainerFieldMapping`

### selectEagerJoin

    public int selectEagerJoin(Select sel,
                               KodoStateManager sm,
                               JDBCStoreManager store,
                               JDBCFetchConfiguration fetch,
                               int eagerMode)

  Description copied from interface: `FieldMapping`
  Use eager joins to select related objects.
  Overrides:
    `selectEagerJoin` in class `AbstractFieldMapping`
  Following copied from interface: `kodo.jdbc.meta.FieldMapping`
  See Also:
    `FieldMapping.select(kodo.jdbc.sql.Select, kodo.runtime.KodoStateManager, kodo.jdbc.runtime.JDBCStoreManager, kodo.jdbc.runtime.JDBCFetchConfiguration, int)`

### isEagerJoinToMany

    public boolean isEagerJoinToMany()

  Description copied from interface: `FieldMapping`
  Whether the eager joins used by this field are to-many.
  Overrides:
    `isEagerJoinToMany` in class `AbstractFieldMapping`

### selectEagerParallel

    public int selectEagerParallel(Select sel,
                                   Select orig,
                                   KodoStateManager sm,
                                   JDBCStoreManager store,
                                   JDBCFetchConfiguration fetch,
                                   int eagerMode)

  Description copied from interface: `FieldMapping`
  Create a parallel eager select for related objects.
  Overrides:
    `selectEagerParallel` in class `AbstractFieldMapping`
  Following copied from interface: `kodo.jdbc.meta.FieldMapping`
  See Also:
    `FieldMapping.select(kodo.jdbc.sql.Select, kodo.runtime.KodoStateManager, kodo.jdbc.runtime.JDBCStoreManager, kodo.jdbc.runtime.JDBCFetchConfiguration, int)`

### loadEagerJoin

    public void loadEagerJoin(KodoStateManager sm,
                              JDBCStoreManager store,
                              JDBCFetchConfiguration fetch,
                              Result res)
                       throws SQLException

  Description copied from interface: `FieldMapping`
  Load the joined eager result.
  Overrides:
    `loadEagerJoin` in class `AbstractFieldMapping`

### loadEagerParallel

    public void loadEagerParallel(KodoStateManager sm,
                                  JDBCStoreManager store,
                                  JDBCFetchConfiguration fetch,
                                  Result res,
                                  Result orig)
                           throws SQLException

  Description copied from interface: `FieldMapping`
  Load the batched eager result.
  Overrides:
    `loadEagerParallel` in class `AbstractFieldMapping`

### load

    public void load(KodoStateManager sm,
                     JDBCStoreManager store,
                     JDBCFetchConfiguration fetch)
              throws SQLException

  Description copied from interface: `FieldMapping`
  Load secondary data using a connection from the store manager.

### toCollection

    protected Collection toCollection(Object array)

  Helper method to return the given array as a collection.

### toArray

    protected Object toArray(Collection coll)

  Helper method to return the given collection as an array.

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.