Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.deegree.io.datastore.schema
Class TableRelation

    java.lang.Object
      org.deegree.io.datastore.schema.TableRelation

    public class TableRelation

extends Object

Describes a relation (join condition) between two database tables.

Version:
  $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
  Markus Schneider , last edited by: $Author: mschneider $

Nested Class Summary
`static class` | `TableRelation.FK_INFO` Used to represent the foreign key position.

Constructor Summary
`TableRelation(MappingField[] fromFields, MappingField[] toFields, TableRelation.FK_INFO fkInfo, IdGenerator idGenerator)` Initializes a newly created `TableRelation` instance with the given parameters.

Method Summary
`TableRelation.FK_INFO` | `getFKInfo()` Returns the foreign key position.
`MappingField[]` | `getFromFields()` Returns the `MappingField`s that constitute the key in the 'From'-table.
`String` | `getFromTable()` Returns the name of the table where the relation starts ('From'-table).
`IdGenerator` | `getIdGenerator()` Returns the `IdGenerator` instance that may be used to generate new primary keys.
`Object` | `getNewPK(DatastoreTransaction ta)` Returns a new primary key generated by the associated `IdGenerator`.
`MappingField[]` | `getToFields()` Returns the `MappingField`s that constitute the key in the 'To'-table.
`String` | `getToTable()` Returns the name of the table where the relation ends ('To'-table).
`boolean` | `isFromFK()` Returns whether the foreign key is stored in the 'From'-table.
`String` | `toString()`

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

Constructor Detail

### TableRelation

    public TableRelation(MappingField[] fromFields,
                         MappingField[] toFields,
                         TableRelation.FK_INFO fkInfo,
                         IdGenerator idGenerator)

  Initializes a newly created `TableRelation` instance with the given parameters.

  Parameters:
    `fromFields` -
    `toFields` -
    `fkInfo` -
    `idGenerator` -

Method Detail

### getFromTable

    public String getFromTable()

  Returns the name of the table where the relation starts ('From'-table).

  Returns:
    the name of the table where the relation starts ('From'-table)

### getToTable

    public String getToTable()

  Returns the name of the table where the relation ends ('To'-table).

  Returns:
    the name of the table where the relation ends ('To'-table)

### getFromFields

    public MappingField[] getFromFields()

  Returns the `MappingField`s that constitute the key in the 'From'-table.

  Returns:
    the MappingFields that constitute the key in the 'From'-table

### getToFields

    public MappingField[] getToFields()

  Returns the `MappingField`s that constitute the key in the 'To'-table.

  Returns:
    the MappingFields that constitute the key in the 'To'-table

### getFKInfo

    public TableRelation.FK_INFO getFKInfo()

  Returns the foreign key position.

  Returns:
    the foreign key position

### isFromFK

    public boolean isFromFK()

  Returns whether the foreign key is stored in the 'From'-table.

  Returns:
    true, if foreign key information is available and foreign key is in 'From'-table, false otherwise

### getIdGenerator

    public IdGenerator getIdGenerator()

  Returns the `IdGenerator` instance that may be used to generate new primary keys.

  Returns:
    IdGenerator instance that may be used to generate new primary keys

### getNewPK

    public Object getNewPK(DatastoreTransaction ta)
                    throws IdGenerationException

  Returns a new primary key generated by the associated `IdGenerator`.

  Parameters:
    `ta` -
  Returns:
    a new primary key
  Throws:
    `IdGenerationException`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org