Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.0.3 generated on February 20 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.jdbc.meta
Interface JoinableMapping

All Known Implementing Classes:
  TransformationFieldMapping, ValueFieldMapping, DelegatingJoinableMapping

public interface JoinableMapping

Represents a mapping that can be joined to. Any column that a user joins to must be "owned" by a field mapping that implements this interface. The only exceptions to this rule are:

- Joining to datastore identity columns.
- Joining to the primary key columns of vertical inheritance tables. Rather than any field mapping owning those columns, the vertical class mapping creates joinable mappings for them.

Method Summary
`Column[]` | `getColumns()` Return this mapping's columns.
`FieldMapping` | `getFieldMapping()` Return the field mapping that owns this mapping's columns.
`int` | `getJoinTypeCode(Column col)` Return the type code from `FieldMapping` of the JDBC value returned from calls to `getJoinValue(kodo.jdbc.sql.Result, kodo.jdbc.schema.Column[], kodo.jdbc.schema.ForeignKey)` for the given column.
`Object` | `getJoinValue(Object fieldVal, Column col)` Return the join value of the given column.
`Object` | `getJoinValue(Result res, Column[] cols, ForeignKey fk)` Return the value for this mapping from the given result, using the given columns.
`void` | `setAutoIncrementValue(KodoStateManager sm, Column col, long autoInc)` Use the given auto-incremented value to set this join value's field on the given instance.

Method Detail

### getFieldMapping

    public FieldMapping getFieldMapping()

  Return the field mapping that owns this mapping's columns. If this is a delegate mapping, return the field mapping of the delegate.

### getColumns

    public Column[] getColumns()

  Return this mapping's columns.

### getJoinValue

    public Object getJoinValue(Result res,
                               Column[] cols,
                               ForeignKey fk)
                        throws SQLException

  Return the value for this mapping from the given result, using the given columns. Outside code will always call this method with the `cols` array from `getColumns()`, but delegates may change the columns to use. If the given foreign key is non-null, use the foreign key's columns by translating the given columns through `ForeignKey.getColumn(kodo.jdbc.schema.Column)`.

### getJoinValue

    public Object getJoinValue(Object fieldVal,
                               Column col)

  Return the join value of the given column.
  Parameters:
    `val` - the value of the field for this mapping
    `col` - the column of this mapping whose value to return

### getJoinTypeCode

    public int getJoinTypeCode(Column col)

  Return the type code from `FieldMapping` of the JDBC value returned from calls to `getJoinValue(kodo.jdbc.sql.Result, kodo.jdbc.schema.Column[], kodo.jdbc.schema.ForeignKey)` for the given column.

### setAutoIncrementValue

    public void setAutoIncrementValue(KodoStateManager sm,
                                      Column col,
                                      long autoInc)

  Use the given auto-incremented value to set this join value's field on the given instance.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.0.3 generated on February 20 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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