org.objectweb.jorm.mapper.rdb.lib
Class RdbExtentMappingInfos

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.lib.RdbExtentMappingInfos

public class RdbExtentMappingInfos
extends java.lang.Object

This class is used to construct extent mapping information when calculating extents (see getNonFinalClassExtent) and that will then be used to generate the appropriate union of select/from/where clauses


Field Summary
static boolean debug
           
static Logger logger
           
static java.lang.String NULL_COLUMN
           
 
Method Summary
 void addJoin(RdbJoin join)
           
 void addProjection(java.lang.String tableName, java.lang.String columnName, java.lang.String aliasName, java.lang.String className, int position)
           
 java.lang.String getAliasName(int position)
           
 Class getClazz()
           
 java.util.Collection getColumnAliases(boolean prefetch, java.lang.String primaryKey, Class cl)
           
 java.util.Collection getColumnAliasesPKAndFields(Class cl)
           
 java.util.Collection getColumnClasses()
           
 java.util.HashSet getFilters()
           
 java.util.HashSet getJoins()
           
 RdbTable getMainTable()
           
 java.lang.String getName()
           
 java.lang.String getSelectParameter(java.lang.String adapterName)
          get a select parameter to give to the getQuery method of adapter this method is called in RdbExtentDefinition.vm when generating the extent definition
 java.lang.String getSelectPKAndFields(RdbAdapter adapter, Class cl)
          Returns a String of type "x1 as y1, x2 as y2, x3 as y3" for the pk and fields case, x1 and x2 composing the primary key, x3 being a field that belongs to the class or one of its super classes.
 java.lang.String getSelectPKOnly(RdbAdapter adapter, java.lang.String primaryKey)
          Returns a String of type "x1 as y1, x2 as y2" for the pk only case, x1 and x2 composing the primary key.
 java.lang.String getSelectPrefetch(RdbAdapter adapter, Class cl)
          Returns a String of type "x1 as y1, x2 as y2, x3 as y3" for the prefetch case.
 java.lang.String getWhereParameter(PClassMapping pcm)
           
 boolean hasJoins()
           
 boolean isEmpty()
           
 boolean mappingDone(int pos)
           
 boolean mappingNull(int pos)
           
 void setMainTable(RdbTable mainTable)
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_COLUMN

public static final java.lang.String NULL_COLUMN
See Also:
Constant Field Values

logger

public static Logger logger

debug

public static boolean debug
Method Detail

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

getClazz

public Class getClazz()

getFilters

public java.util.HashSet getFilters()

getMainTable

public RdbTable getMainTable()

setMainTable

public void setMainTable(RdbTable mainTable)

getJoins

public java.util.HashSet getJoins()

addJoin

public void addJoin(RdbJoin join)

isEmpty

public boolean isEmpty()

addProjection

public void addProjection(java.lang.String tableName,
                          java.lang.String columnName,
                          java.lang.String aliasName,
                          java.lang.String className,
                          int position)

getSelectParameter

public java.lang.String getSelectParameter(java.lang.String adapterName)
get a select parameter to give to the getQuery method of adapter this method is called in RdbExtentDefinition.vm when generating the extent definition

Parameters:
adapterName - the name of the adapter in the generated code
Returns:
a string to include as the first parameter of the call to getQuery in the generated code

getSelectPrefetch

public java.lang.String getSelectPrefetch(RdbAdapter adapter,
                                          Class cl)
Returns a String of type "x1 as y1, x2 as y2, x3 as y3" for the prefetch case.

Parameters:
adapter -
Returns:

getSelectPKOnly

public java.lang.String getSelectPKOnly(RdbAdapter adapter,
                                        java.lang.String primaryKey)
Returns a String of type "x1 as y1, x2 as y2" for the pk only case, x1 and x2 composing the primary key.

Parameters:
adapter -
primaryKey - the list of columns belonging to the primaryKey
Returns:

getSelectPKAndFields

public java.lang.String getSelectPKAndFields(RdbAdapter adapter,
                                             Class cl)
Returns a String of type "x1 as y1, x2 as y2, x3 as y3" for the pk and fields case, x1 and x2 composing the primary key, x3 being a field that belongs to the class or one of its super classes.


getWhereParameter

public java.lang.String getWhereParameter(PClassMapping pcm)

getAliasName

public java.lang.String getAliasName(int position)

getColumnAliases

public java.util.Collection getColumnAliases(boolean prefetch,
                                             java.lang.String primaryKey,
                                             Class cl)
Parameters:
prefetch -
primaryKey - : the String representing the fields composing the primary key
cl - : if prefetch is true, this parameter is not used and the getColumnAliasesPrefetch method is called else if cl is null the getColumnAliasesPKOnly method is called else the getColumnAliasesPKAndFields method is called
Returns:

getColumnAliasesPKAndFields

public java.util.Collection getColumnAliasesPKAndFields(Class cl)

getColumnClasses

public java.util.Collection getColumnClasses()

mappingDone

public boolean mappingDone(int pos)

mappingNull

public boolean mappingNull(int pos)

hasJoins

public boolean hasJoins()