org.objectweb.jorm.mapper.rdb.metainfo
Class RdbJoin

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.mapper.rdb.metainfo.RdbJoin
All Implemented Interfaces:
java.lang.Comparable, Loggable, MetaObject, java.io.Serializable

public class RdbJoin
extends BasicMetaObject
implements java.lang.Comparable

Implementation of the RdbJoin interface. It represents the structure of a join between an external table and its corresponding main table. The join relationship requires two columns represented by primaryTableColumnName and externalTableColumnName. As a meta-object the parent is the external table. The main table is retrieved through the external table.

See Also:
RdbClassMultiMapping, Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Constructor Summary
RdbJoin(RdbExternalTable externalTable, java.lang.String name)
          Builds a new BasicRdbJoin object between an external table and its asociated main table.
 
Method Summary
 void addJoinColumnNames(java.lang.String ptJoinColumnName, java.lang.String etJoinColumnName)
          Adds two join column names
 int compareTo(java.lang.Object o)
          Compares the join to another join.
 java.util.List getETJoinColumnNames()
          Returns the list of the column names of the primary (main) table involved in the join.
 RdbExternalTable getExternalTable()
          Returns the external table involved in the join.
 RdbTable getMainTable()
          Returns the main table involved in the join.
 java.lang.String getName()
           
 java.util.List getPTJoinColumnNames()
          Returns the list of the column names of the primary (main) table involved in the join.
 void setName(java.lang.String name)
           
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getChildren, getLogger, getLoggerFactory, getManager, getParent, setLogger, setLoggerFactory, setLoggingOnChild, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdbJoin

public RdbJoin(RdbExternalTable externalTable,
               java.lang.String name)
Builds a new BasicRdbJoin object between an external table and its asociated main table. The list of joined columns is given afterwhile by calling the addJoinColumnNames.

Parameters:
externalTable - the external table of the join.
name - the name given to the join meta-object
Method Detail

getExternalTable

public RdbExternalTable getExternalTable()
Returns the external table involved in the join.

Returns:
the external table involved in the join.

getMainTable

public RdbTable getMainTable()
Returns the main table involved in the join. Retrieved through the external table.

Returns:
the external table involved in the join.

compareTo

public int compareTo(java.lang.Object o)
Compares the join to another join. Join meta-object are equal if their names are equal.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the join meta-object to which comparing this join meta-object
Returns:
true is join mata-objects have the same names

getPTJoinColumnNames

public java.util.List getPTJoinColumnNames()
Returns the list of the column names of the primary (main) table involved in the join. If main T1 and ext T2 joined through T1.c11 == T2.c21 ... T1.c1n == T2.c2n, then this method returns (c11, ..., c1n)

Returns:
the list of the column names of the primary (main) table involved in the join.

getETJoinColumnNames

public java.util.List getETJoinColumnNames()
Returns the list of the column names of the primary (main) table involved in the join. If main T1 and ext T2 joined through T1.c11 == T2.c21 ... T1.c1n == T2.c2n, then this method returns (c21, ..., c2n)

Returns:
the list of the column names of the primary (main) table involved in the join.

addJoinColumnNames

public void addJoinColumnNames(java.lang.String ptJoinColumnName,
                               java.lang.String etJoinColumnName)
Adds two join column names


getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)