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

Class 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

String
alias
is the alias name the current table.
List
joinedTables
List of JoinedTable.
List
joins
List of Join instaces.
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(String tablename)
Build a JoinedTable with a particular table name.
JoinedTable(String tablename, String alias)
Build a JoinedTable with a particular table name and alias name.

Method Summary

Object
clone(Object clone, java.util.Map obj2clone)
Clone the current JoinedTable with a context.
boolean
contains(JoinedTable jt)
JoinedTable.Join
createChildren(String tablename)
Creates a new Join instance to a new JoinedTable
JoinedTable.Join
createChildren(String tablename, String alias)
Creates a new Join instance to a new JoinedTable
JoinedTable.Join
createChildren(String tablename, String alias, boolean outer)
Creates a new Join instance to a new JoinedTable
JoinedTable.Join
createChildren(String tablename, boolean outer)
Creates a new Join instance to a new JoinedTable
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
static Object
getClone(JoinedTable obj, java.util.Map obj2clone)

Field Details

alias

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


joinedTables

public 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.


joins

public 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.


tableName

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

Constructor Details

JoinedTable

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


JoinedTable

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

Parameters:
tablename - is the name of the table


JoinedTable

public JoinedTable(String tablename,
                   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 Details

clone

public Object clone(Object clone,
                    java.util.Map obj2clone)
            throws 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.


contains

public boolean contains(JoinedTable jt)

Returns:
a boolean value indicating if a given JoinedTable is the joinedtables of the current JoinedTable


createChildren

public JoinedTable.Join createChildren(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(String tablename,
                                       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(String tablename,
                                       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(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(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.


getClone

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