org.objectweb.jorm.mapper.rdb.adapter.api
Class JoinedTable

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.adapter.api.JoinedTable

public class JoinedTable
extends java.lang.Object

is a recursive structure representing join between tables.

Author:
S.Chassande-Barrioz

Nested Class Summary
 class JoinedTable.Join
          defines a join between two tables.
 
Field Summary
 java.lang.String alias
          is the alias name the current table.
 java.util.List joinedTables
          List of JoinedTable.
 java.util.List joins
          List of Join instaces.
 java.lang.String tableName
          the name of the current table.
 
Constructor Summary
JoinedTable()
          no arg constructor required for cloning, but must not be used in usual case.
JoinedTable(java.lang.String tablename)
          Build a JoinedTable with a particular table name.
JoinedTable(java.lang.String tablename, java.lang.String alias)
          Build a JoinedTable with a particular table name and alias name.
 
Method Summary
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
          Clone the current JoinedTable with a context.
 boolean contains(JoinedTable jt)
           
 JoinedTable.Join createChildren(JoinedTable jt)
          Creates a new Join instance to a given JoinedTable
 JoinedTable.Join createChildren(JoinedTable jt, boolean outer)
          Creates a new Join instance to a given JoinedTable
 JoinedTable.Join createChildren(java.lang.String tablename)
          Creates a new Join instance to a new JoinedTable
 JoinedTable.Join createChildren(java.lang.String tablename, boolean outer)
          Creates a new Join instance to a new JoinedTable
 JoinedTable.Join createChildren(java.lang.String tablename, java.lang.String alias)
          Creates a new Join instance to a new JoinedTable
 JoinedTable.Join createChildren(java.lang.String tablename, java.lang.String alias, boolean outer)
          Creates a new Join instance to a new JoinedTable
static java.lang.Object getClone(JoinedTable obj, java.util.Map obj2clone)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

joins

public java.util.List joins
List of Join instaces. The Join instance at the N position describes the join between the current table (first table) and the JoinedTable at the position N in the list 'joinedTables' (second table). Therefore the joins list has the exactly the same size than the 'joinedTables' list. this is list can be empty if not joined table are linked to the current.


joinedTables

public java.util.List joinedTables
List of JoinedTable. The JoinedTable instance at the N position is linked to the current JoinedTable by the a join desribes by the Join instance at the position N in the list 'joins'. Therefore the joinedTables list has the exactly the same size than the 'joins' list. this is list can be empty if not joined table are linked to the current.


tableName

public java.lang.String tableName
the name of the current table. never null


alias

public java.lang.String alias
is the alias name the current table. It can be null if no alias is required.

Constructor Detail

JoinedTable

public JoinedTable()
no arg constructor required for cloning, but must not be used in usual case.


JoinedTable

public JoinedTable(java.lang.String tablename)
Build a JoinedTable with a particular table name.

Parameters:
tablename - is the name of the table

JoinedTable

public JoinedTable(java.lang.String tablename,
                   java.lang.String alias)
Build a JoinedTable with a particular table name and alias name.

Parameters:
tablename - is the name of the table
alias - is the name of the alias
Method Detail

createChildren

public JoinedTable.Join createChildren(java.lang.String tablename)
Creates a new Join instance to a new JoinedTable

Parameters:
tablename - is the name of the new JoinedTable
Returns:
the Join instance representing the join between the current table and the created JoinedTable.

createChildren

public JoinedTable.Join createChildren(java.lang.String tablename,
                                       boolean outer)
Creates a new Join instance to a new JoinedTable

Parameters:
tablename - is the name of the new JoinedTable
outer - indicates whether the join should be outer or inner
Returns:
the Join instance representing the join between the current table and the created JoinedTable.

createChildren

public JoinedTable.Join createChildren(java.lang.String tablename,
                                       java.lang.String alias)
Creates a new Join instance to a new JoinedTable

Parameters:
tablename - is the name of the new JoinedTable
alias - is the alias name of the new JoinedTable
Returns:
the Join instance representing the join between the current table and the created JoinedTable.

createChildren

public JoinedTable.Join createChildren(java.lang.String tablename,
                                       java.lang.String alias,
                                       boolean outer)
Creates a new Join instance to a new JoinedTable

Parameters:
tablename - is the name of the new JoinedTable
alias - is the alias name of the new JoinedTable
outer - indicates whether the join should be outer or inner
Returns:
the Join instance representing the join between the current table and the created JoinedTable.

createChildren

public JoinedTable.Join createChildren(JoinedTable jt)
Creates a new Join instance to a given JoinedTable

Parameters:
jt - is a JoinedTable
Returns:
the Join instance representing the join between the current table and the given JoinedTable.

createChildren

public JoinedTable.Join createChildren(JoinedTable jt,
                                       boolean outer)
Creates a new Join instance to a given JoinedTable

Parameters:
jt - is a JoinedTable
outer - indicates whether the join should be outer or inner
Returns:
the Join instance representing the join between the current table and the given JoinedTable.

contains

public boolean contains(JoinedTable jt)
Returns:
a boolean value indicating if a given JoinedTable is the joinedtables of the current JoinedTable

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Clone the current JoinedTable with a context.

Parameters:
clone - is the clone instance to fill with the value of the current instance. If this parameter is null, the implementation has o create a new one.
obj2clone - is a map between object already cloned and their clone instance
Returns:
the clone instance of the current instance.
Throws:
java.lang.CloneNotSupportedException

getClone

public static java.lang.Object getClone(JoinedTable obj,
                                        java.util.Map obj2clone)
                                 throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException