Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.rd.kodo.impl.jdbc.meta.map
Class ReferenceMapping

    java.lang.Object
      |
      +--com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
            |
            +--com.solarmetric.rd.kodo.impl.jdbc.meta.ExtensionsMapping
                  |
                  +--com.solarmetric.rd.kodo.impl.jdbc.meta.FieldMapping
                        |
                        +--com.solarmetric.rd.kodo.impl.jdbc.meta.map.ReferenceMapping

All Implemented Interfaces:
  java.lang.Comparable, Extensions, FieldMetaData

Direct Known Subclasses:
  ColumnMapping, ContainerMapping, EmbeddedOneToOneMapping, OneToOneMapping

public abstract class ReferenceMapping
extends FieldMapping

Base class of most field mappings. Maps a value that might be in a table other than the owning class' table, and manages the reference foreign key linking to the parent table (if such a key exists).

Field Summary

Fields inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.FieldMapping
`CONTAINER_META, DELETE_ACTION, ELEMENT_DELETE_ACTION, ELEMENT_INDEXED, ELEMENT_SIZE, EMPTY_COLUMNS, INDEXED, KEY_DELETE_ACTION, KEY_INDEXED, KEY_SIZE, ORDERED, REF_DELETE_ACTION, REF_INDEXED, SIZE, 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, USE_FIELD_MAP, USE_NULL_IND, VALUE_DELETE_ACTION, VALUE_INDEXED, VALUE_SIZE`

Fields inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
`DEFAULT, FALSE, LOB, TRUE, UNIQUE`

Fields inherited from interface com.solarmetric.rd.kodo.meta.FieldMetaData
`DEPENDENT, ELEMENT_DEPENDENT, ELEMENT_PC_CLASS, INVERSE_OWNER, KEY_DEPENDENT, KEY_PC_CLASS, MANAGE_NONE, MANAGE_PERSISTENT, MANAGE_TRANSACTIONAL, NULL_DEFAULT, NULL_EXCEPTION, NULL_NONE, PC_CLASS, 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, VALUE_DEPENDENT, VALUE_PC_CLASS`

Constructor Summary
`ReferenceMapping(com.solarmetric.rd.kodo.meta.FieldMetaData meta)` Constructor.

Method Summary
`protected void` | `createRefForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)` Creates the reference foreign key on the given secondary table.
`protected boolean` | `fromMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info, boolean adapt, boolean fkRequired)`
`com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey` | `getRefForeignKey()` Return the foreign key linking this mapping to the parent table.
`protected com.solarmetric.rd.kodo.impl.jdbc.runtime.Joins` | `getSelectJoins(com.solarmetric.rd.kodo.impl.jdbc.runtime.Select sel)` Return any joins needed to get from this table to the primary table.
`com.solarmetric.rd.kodo.impl.jdbc.schema.Table` | `getTable()` Return the mapping's data table.
`protected void` | `join(com.solarmetric.rd.kodo.impl.jdbc.runtime.Joins joins, boolean toMany)` Joins from the owning class' table to the table where this field lies using the reference foreign key.
`void` | `refSchemaComponents()` Increment the reference count of all used schema components.
`void` | `setRefForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)` Set the foreign key linking this mapping to the parent table.
`void` | `toMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info)` Serialize this mapping to a simple `MappingInfo` instance for transfer to XML or some other format.
`protected void` | `wherePrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.runtime.Select sel, java.lang.Object oid)` Add a `wherePrimaryKey` or `whereForeignKey` condition to the given select, depending on whether we have a reference foreign key.

Methods inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.FieldMapping
`addExtension, addExtension, appendIsEmpty, appendIsNotNull, appendIsNull, checkRepository, compareTo, deleteEmbedded, deleteEmbedded, getBooleanExtension, getBooleanExtension, getColumns, getContainerMeta, getDataStoreValue, getDeclaredElementType, getDeclaredIndex, getDeclaredKeyType, getDeclaredType, getDefaults, getDeleteAction, getDoubleExtension, getDoubleExtension, getElementDeleteAction, getElementIndexed, getElementPCClass, getElementSize, getElementType, getElementTypeCode, getElementTypeMapping, getElementTypeMetaData, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getFieldFlag, getFullName, getIndex, getIndexed, getIntExtension, getIntExtension, getInverseOwner, getInverseOwnerMapping, getInverseOwnerMetaData, getKeyColumns, getKeyDataStoreValue, getKeyDeleteAction, getKeyIndexed, getKeyPCClass, getKeySize, getKeyType, getKeyTypeCode, getKeyTypeMapping, getKeyTypeMetaData, getManagement, getMappingRepository, getMetaData, getName, getNullValue, getObjectExtension, getObjectExtension, getOrdered, getOwner, getOwnerMapping, getPCClass, getRefDeleteAction, getRefIndexed, getSize, getStringExtension, getStringExtension, getType, getTypeCode, getTypeMapping, getTypeMetaData, getUseFieldMapping, getUseNullIndicator, getVRowTable, hasExtension, hasExtension, invalidateResolve, isCustomDeleteEmbedded, isCustomNullEmbedded, isDeleteActionDeferred, isDependent, isEager, isElementDeleteActionDeferred, isElementDependent, isElementEager, isEmbedded, isEmbeddedElement, isEmbeddedKey, isEmpty, isExplicit, isInDefaultFetchGroup, isKeyDeleteActionDeferred, isKeyDependent, isKeyEager, isPrimaryKey, isRefDeleteActionDeferred, isValue, join, joinKey, joinKeyRelation, joinRelation, load, load, newInstance, newInstance, nullEmbedded, nullEmbedded, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension, resolve, select, selectVRowData, setContainerMeta, setDeclaredIndex, setDeleteAction, setDependent, setElementDeleteAction, setElementDependent, setElementIndexed, setElementPCClass, setElementSize, setElementType, setEmbedded, setEmbeddedElement, setEmbeddedKey, setExplicit, setInDefaultFetchGroup, setIndex, setIndexed, setInverseOwner, setKeyDeleteAction, setKeyDependent, setKeyIndexed, setKeyPCClass, setKeySize, setKeyType, setManagement, setName, setNullValue, setOrdered, setOwner, setPCClass, setPrimaryKey, setRefDeleteAction, setRefIndexed, setSize, setType, setUseFieldMapping, setUseNullIndicator, toString`

Methods inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
`checkIndex, createColumn, delete, delete, fromMappingInfo, getDBDictionary, getForeignKey, getLog, getMappingType, getSchemaGroup, insert, insert, invalidMapping, isCustomDelete, isCustomInsert, isCustomUpdate, map, reverseMap, setForeignKey, update, update`

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

Methods inherited from interface com.solarmetric.rd.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`

Constructor Detail

### ReferenceMapping

    public ReferenceMapping(com.solarmetric.rd.kodo.meta.FieldMetaData meta)

  Constructor. Supply underlying metadata.

Method Detail

### getRefForeignKey

    public com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey getRefForeignKey()

  Return the foreign key linking this mapping to the parent table.

### setRefForeignKey

    public void setRefForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)

  Set the foreign key linking this mapping to the parent table.

### getTable

    public com.solarmetric.rd.kodo.impl.jdbc.schema.Table getTable()

  Description copied from class: `Mapping`
  Return the mapping's data table.

  Specified by:
    `getTable` in class `Mapping`

### toMappingInfo

    public void toMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info)

  Description copied from class: `Mapping`
  Serialize this mapping to a simple `MappingInfo` instance for transfer to XML or some other format.

  Specified by:
    `toMappingInfo` in class `Mapping`

### fromMappingInfo

    protected boolean fromMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
                                      boolean adapt,
                                      boolean fkRequired)

### refSchemaComponents

    public void refSchemaComponents()

  Description copied from class: `Mapping`
  Increment the reference count of all used schema components.

  Specified by:
    `refSchemaComponents` in class `Mapping`

### createRefForeignKey

    protected void createRefForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)

  Creates the reference foreign key on the given secondary table.

### join

    protected void join(com.solarmetric.rd.kodo.impl.jdbc.runtime.Joins joins,
                        boolean toMany)

  Joins from the owning class' table to the table where this field lies using the reference foreign key.

### wherePrimaryKey

    protected void wherePrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.runtime.Select sel,
                                   java.lang.Object oid)

  Add a `wherePrimaryKey` or `whereForeignKey` condition to the given select, depending on whether we have a reference foreign key.

### getSelectJoins

    protected com.solarmetric.rd.kodo.impl.jdbc.runtime.Joins getSelectJoins(com.solarmetric.rd.kodo.impl.jdbc.runtime.Select sel)

  Return any joins needed to get from this table to the primary table.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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