deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.datastore.schema
Class TableRelation

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

public class TableRelation
extends java.lang.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 MappingFields that constitute the key in the 'From'-table.
 java.lang.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.
 java.lang.Object getNewPK(DatastoreTransaction ta)
          Returns a new primary key generated by the associated IdGenerator.
 MappingField[] getToFields()
          Returns the MappingFields that constitute the key in the 'To'-table.
 java.lang.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.
 java.lang.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 java.lang.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 java.lang.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 MappingFields 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 MappingFields 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 java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

deegree 2.5 (2011/06/29 09:44 build-8-official)

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