org.objectweb.jorm.mapper.rdb.generator
Class RdbGenTable

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.generator.RdbGenTable

public class RdbGenTable
extends java.lang.Object

Defines one of the table that is used to mapped a particular JORM class. In case of the main table (see RdbGenInfos), no join information is defined.

Author:
P. Dechamboux

Field Summary
 java.util.List colocatedColumns
          The list of columns of this table that are shared with a colocated object (i.e., an object stored into the same table along with this object.
 boolean colocatedTable
          Tells that this table stores colocated objects.
 java.util.List columns
          The list of columns of this table used in this mapping.
 RdbGenInfos genInfos
           
 java.util.List inheritedColumns
          The list of inherited columns of this table used in this mapping.
 boolean isMainTable
          indicates if the table is the main table of a the class
 java.util.Map jn2join
           
 java.util.List joins
           
 boolean mustGenerateUpdate
          indicates if code must be generated to update the table when updating an instance
 boolean readOnly
          indicates if the table is a read-only table
 java.lang.String tableName
          The name of the table involved in this mapping.
 
Constructor Summary
RdbGenTable()
           
RdbGenTable(RdbExternalTable extTable, RdbGenTable mainTable, Class clazz, RdbGenInfos genInfos)
          Creates an RdbGenTable from an external table.
RdbGenTable(RdbTable mainTable, Class clazz, RdbGenInfos genInfos)
          Creates an RdbGenTable from a main table.
 
Method Summary
 void fixMustGenerateUpdate()
          Fix the mustGenerateUpdate attribute.
 java.util.List getColocatedColumns()
           
 boolean getColocatedTable()
           
 RdbGenColumn getColumn(java.lang.String columnName)
          get the genColumn corresponding to the given column columnName.
 java.util.List getColumns()
           
 RdbGenInfos getGenInfos()
           
 java.util.List getInheritedColumns()
           
 java.util.List getJoins()
           
 boolean getMustGenerateUpdate()
           
 boolean getReadOnly()
           
 java.lang.String getTableName()
           
 java.lang.String getTableNameNoDot()
           
 boolean isMainTable()
           
 boolean preparedStatementMandatory()
          Tells if only PreparedStatement can be used to store data associated with this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

genInfos

public RdbGenInfos genInfos

tableName

public java.lang.String tableName
The name of the table involved in this mapping.


columns

public java.util.List columns
The list of columns of this table used in this mapping.


inheritedColumns

public java.util.List inheritedColumns
The list of inherited columns of this table used in this mapping.


colocatedColumns

public java.util.List colocatedColumns
The list of columns of this table that are shared with a colocated object (i.e., an object stored into the same table along with this object.


colocatedTable

public boolean colocatedTable
Tells that this table stores colocated objects.


joins

public java.util.List joins

jn2join

public java.util.Map jn2join

readOnly

public boolean readOnly
indicates if the table is a read-only table


mustGenerateUpdate

public boolean mustGenerateUpdate
indicates if code must be generated to update the table when updating an instance


isMainTable

public boolean isMainTable
indicates if the table is the main table of a the class

Constructor Detail

RdbGenTable

public RdbGenTable()

RdbGenTable

public RdbGenTable(RdbExternalTable extTable,
                   RdbGenTable mainTable,
                   Class clazz,
                   RdbGenInfos genInfos)
            throws PException
Creates an RdbGenTable from an external table.

Parameters:
extTable - the external table
mainTable - the associated main table
clazz - the associated table
Throws:
PException

RdbGenTable

public RdbGenTable(RdbTable mainTable,
                   Class clazz,
                   RdbGenInfos genInfos)
            throws PException
Creates an RdbGenTable from a main table.

Parameters:
mainTable - the associated main table
clazz - the associated table
Throws:
PException
Method Detail

fixMustGenerateUpdate

public void fixMustGenerateUpdate()
Fix the mustGenerateUpdate attribute. One must generate code to update the table when an instance of the jorm class (to which the genTable is associated) is updated. The table is concerned only if there are columns which do not participate in the join with the main table nor in the identifier


getMustGenerateUpdate

public boolean getMustGenerateUpdate()

getReadOnly

public boolean getReadOnly()

getJoins

public java.util.List getJoins()

getGenInfos

public RdbGenInfos getGenInfos()

getTableName

public java.lang.String getTableName()

getTableNameNoDot

public java.lang.String getTableNameNoDot()

getColumns

public java.util.List getColumns()

getInheritedColumns

public java.util.List getInheritedColumns()

getColocatedColumns

public java.util.List getColocatedColumns()

getColocatedTable

public boolean getColocatedTable()

isMainTable

public boolean isMainTable()

preparedStatementMandatory

public boolean preparedStatementMandatory()
Tells if only PreparedStatement can be used to store data associated with this table.

Returns:
true if the use of PreparedStatement is mandatory.

getColumn

public RdbGenColumn getColumn(java.lang.String columnName)
get the genColumn corresponding to the given column columnName. If not found in this table definition, search in the table definition of the super classes

Parameters:
columnName - the name of a column in the table
Returns:
the genColumn corresponding to the column name