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
Interface Mapping

All Known Subinterfaces:
  ClassMapping, FieldMapping

All Known Implementing Classes:
  AbstractClassMapping, AbstractFieldMapping, Indicator

public interface Mapping

Interface implemented by all mappings.

Method Summary
`void` | `addMappingInfoAttributes(Collection attrs)` Add all mapping attributes names used by this mapping to the given collection.
`void` | `delete(KodoStateManager sm, JDBCStoreManager store)` Override this method to customize flushing this mapping.
`void` | `delete(KodoStateManager sm, RowManager rm)` Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates.
`void` | `fromMappingInfo(MappingInfo info, boolean adapt)` Deserialize this mapping from a simple `MappingInfo` instance parsed from XML or some other format.
`MappingRepository` | `getMappingRepository()` Return the mapping's repository.
`String` | `getMappingType()` Return the abbreviated name of this mapping, or the full class name if it is a custom mapping.
`Table` | `getTable()` Return the mapping's primary data table.
`void` | `insert(KodoStateManager sm, JDBCStoreManager store)` Override this method to customize flushing this mapping.
`void` | `insert(KodoStateManager sm, RowManager rm)` Set values for the mapping into the proper rows.
`Boolean` | `isCustomDelete(KodoStateManager sm)` Return `Boolean.FALSE` if this mapping does not customize the delete process, `Boolean.TRUE` if it does, or null if it does customize the delete, but also relies on the standard delete method being called.
`Boolean` | `isCustomInsert(KodoStateManager sm)` Return `Boolean.FALSE` if this mapping does not customize the insert process, `Boolean.TRUE` if it does, or null if it does customize the insert, but also relies on the standard insert method being called.
`Boolean` | `isCustomUpdate(KodoStateManager sm)` Return `Boolean.FALSE` if this mapping does not customize the update process, `Boolean.TRUE` if it does, or null if it does customize the update, but also relies on the standard update method being called.
`boolean` | `map()` Map a new instance of this mapping type.
`void` | `refSchemaComponents()` Increment the reference count of all used schema components.
`void` | `reverseMap(SchemaGroup schema, ReverseMappingTool tool)` Create mappings from the schema, using the given tool.
`void` | `toMappingInfo(MappingInfo info)` Serialize this mapping to a simple `MappingInfo` instance for transfer to XML or some other format.
`void` | `update(KodoStateManager sm, JDBCStoreManager store)` Override this method to customize flushing this mapping.
`void` | `update(KodoStateManager sm, RowManager rm)` Set values for the mapping into the proper rows.

Method Detail

### getMappingRepository

    public MappingRepository getMappingRepository()

  Return the mapping's repository.

### getMappingType

    public String getMappingType()

  Return the abbreviated name of this mapping, or the full class name if it is a custom mapping.

### toMappingInfo

    public void toMappingInfo(MappingInfo info)

  Serialize this mapping to a simple `MappingInfo` instance for transfer to XML or some other format.

### fromMappingInfo

    public void fromMappingInfo(MappingInfo info,
                                boolean adapt)

  Deserialize this mapping from a simple `MappingInfo` instance parsed from XML or some other format. If the info is incompatible and `adapt` is true, try to adapt to the new info. This method must validate the given mapping information using the `SchemaGroup.findTable(kodo.jdbc.schema.Table)` method to find any needed tables, the `Table.getColumn(java.lang.String)` method to retrieve columns from those tables, and the `Column.isCompatible(int, int)` method to check all column types. This validation is important, as some schema groups use these methods to build themselves up dynamically rather than reading schema information from the database.
  Throws:
    `MappingInfoNotFoundException` - if the given info is invalid

### addMappingInfoAttributes

    public void addMappingInfoAttributes(Collection attrs)

  Add all mapping attributes names used by this mapping to the given collection. For foreign key attributes, add the prefix.

### map

    public boolean map()

  Map a new instance of this mapping type. If the underlying metadata cannot be mapped using this type, return false.

### reverseMap

    public void reverseMap(SchemaGroup schema,
                           ReverseMappingTool tool)

  Create mappings from the schema, using the given tool. Implement this method if you want the class mapping to be a candidate when reverse-mapping a schema to java classes. Note that this method will be invoked on a template instance, so you cannot rely on the metadata or owning repository being set.

### getTable

    public Table getTable()

  Return the mapping's primary data table.

### refSchemaComponents

    public void refSchemaComponents()

  Increment the reference count of all used schema components.

### insert

    public void insert(KodoStateManager sm,
                       RowManager rm)
                throws SQLException

  Set values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.

### update

    public void update(KodoStateManager sm,
                       RowManager rm)
                throws SQLException

  Set values for the mapping into the proper rows.
  See Also:
    `insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)`

### delete

    public void delete(KodoStateManager sm,
                       RowManager rm)
                throws SQLException

  Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. This allows foreign key analysis.
  See Also:
    `insert(kodo.runtime.KodoStateManager, kodo.jdbc.sql.RowManager)`

### isCustomInsert

    public Boolean isCustomInsert(KodoStateManager sm)

  Return `Boolean.FALSE` if this mapping does not customize the insert process, `Boolean.TRUE` if it does, or null if it does customize the insert, but also relies on the standard insert method being called. Implement the `#insert(KodoStateManager,JDBCStoreManager,Connection)` method to implement the custom insertion behavior.

### isCustomUpdate

    public Boolean isCustomUpdate(KodoStateManager sm)

  Return `Boolean.FALSE` if this mapping does not customize the update process, `Boolean.TRUE` if it does, or null if it does customize the update, but also relies on the standard update method being called. Implement the `#update(KodoStateManager,JDBCStoreManager,Connection)` method to override the default update behavior.

### isCustomDelete

    public Boolean isCustomDelete(KodoStateManager sm)

  Return `Boolean.FALSE` if this mapping does not customize the delete process, `Boolean.TRUE` if it does, or null if it does customize the delete, but also relies on the standard delete method being called. Implement the `#delete(KodoStateManager,JDBCStoreManager,Connection)` method to override the default deletion behavior.

### insert

    public void insert(KodoStateManager sm,
                       JDBCStoreManager store)
                throws SQLException

  Override this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method is called after the owning object is inserted, so if this field is in a row with other fields, that row will already exist.

### update

    public void update(KodoStateManager sm,
                       JDBCStoreManager store)
                throws SQLException

  Override this method to customize flushing this mapping. For classes, this method must also flush all fields.

### delete

    public void delete(KodoStateManager sm,
                       JDBCStoreManager store)
                throws SQLException

  Override this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method will be called after the owning object is deleted.

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.