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

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

public class RdbGenColumn
extends java.lang.Object

This class contains all required information related to a column to which some field of a JORM class is mapped.

Author:
P. Dechamboux

Field Summary
 boolean columnInPK
          Tells if this column belongs to the table primary key.
 java.lang.String columnName
          The name of the RDB column.
 boolean columnNotNull
          Tells if this column may store null values.
 int columnSize
          The size of the RDB column in case of string, serialized, [byte|char]array...
 java.lang.String columnSqlType
          the sql type of the column.
 RdbGenTable columnTable
          The table descrption which this column belongs to.
 PType columnType
          The JORM type associated with this mapped field.
 java.lang.String fieldName
          The name of the field that is mapped to this column.
 java.lang.String fixedValue
          Contains the predicate value associated with the column.
 boolean hiddenField
          Tells is this field is an hidden one.
 boolean hiddenFilterField
          Tells is this field is an hidden filter field.
 RdbGenColumn joinCol
          references a column in the main table in case of this column represents a join column in an external table.
 java.util.List joins
          contains the association between a RdbGenJoin and a primitive element.
 java.util.List pes
           
 
Constructor Summary
RdbGenColumn()
           
 
Method Summary
 boolean columnInPK()
           
 java.lang.String getAccessorValue(RdbGenInfos genInfos, boolean isSpecific)
           
 java.lang.String getAccessorValue(RdbGenInfos genInfos, boolean isSpecific, RdbGenJoin rgj)
           
 java.lang.String getColumnInPK()
           
 java.lang.String getColumnName()
           
 java.lang.String getColumnName(java.lang.String tableSuffix)
           
 java.lang.String getColumnNotNull()
           
 java.lang.String getColumnSqlType()
           
 RdbGenTable getColumnTable()
           
 PType getColumnType()
           
 java.lang.String getFieldName()
           
 java.lang.String getFieldName(RdbGenJoin rgj)
           
 java.lang.String getFieldVal(java.lang.String fieldval)
           
 java.lang.String getFixedValue()
           
 RdbGenColumn getJoinCol()
           
 java.util.List getJoins()
           
 java.lang.String getRefValue(RdbGenInfos genInfos, boolean isSpecific)
           
 java.lang.String getRefValue(RdbGenInfos genInfos, boolean isSpecific, RdbGenJoin rgj)
           
 java.lang.String getSqlGet(java.lang.String resultset, int pos, RdbAdapter adapter)
          Constructs the string that defines the way to access to the relevant result part into a particular ResultSet.
 java.lang.String getSqlSet(java.lang.String pstmt, int pos, RdbAdapter adapter)
          Constructs the string that defines the way to assign to the relevant query parameter into a particular prepared statement.
 java.lang.String getSqlType(RdbAdapter adapter)
          Gets the SQL type associated with this column into the database for which we define the mapping.
 int getSqlTypeCode(PType pt, RdbAdapter adapter)
           
 boolean isColumnInPK()
           
 boolean isColumnNotNull()
           
 boolean isHiddenField()
           
 boolean isHiddenFilterField()
           
 boolean isInJoin(RdbGenJoin rgj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldName

public java.lang.String fieldName
The name of the field that is mapped to this column.


hiddenField

public boolean hiddenField
Tells is this field is an hidden one.


hiddenFilterField

public boolean hiddenFilterField
Tells is this field is an hidden filter field.


fixedValue

public java.lang.String fixedValue
Contains the predicate value associated with the column.


columnName

public java.lang.String columnName
The name of the RDB column.


columnSize

public int columnSize
The size of the RDB column in case of string, serialized, [byte|char]array...


columnType

public PType columnType
The JORM type associated with this mapped field.


columnNotNull

public boolean columnNotNull
Tells if this column may store null values.


columnInPK

public boolean columnInPK
Tells if this column belongs to the table primary key.


columnTable

public RdbGenTable columnTable
The table descrption which this column belongs to.


columnSqlType

public java.lang.String columnSqlType
the sql type of the column. A null value means to use the value of the choosen by the adapter.


joinCol

public RdbGenColumn joinCol
references a column in the main table in case of this column represents a join column in an external table. In other case this field is null.


joins

public java.util.List joins
contains the association between a RdbGenJoin and a primitive element. This field is null is the current column is a column of the main table, because no join is needed of course.


pes

public java.util.List pes
Constructor Detail

RdbGenColumn

public RdbGenColumn()
Method Detail

getJoinCol

public RdbGenColumn getJoinCol()

getColumnSqlType

public java.lang.String getColumnSqlType()

getFieldName

public java.lang.String getFieldName()

getFieldName

public java.lang.String getFieldName(RdbGenJoin rgj)
                              throws PException
Throws:
PException

getJoins

public java.util.List getJoins()

isHiddenField

public boolean isHiddenField()

isHiddenFilterField

public boolean isHiddenFilterField()

getFixedValue

public java.lang.String getFixedValue()

getColumnName

public java.lang.String getColumnName()

getColumnType

public PType getColumnType()

isColumnNotNull

public boolean isColumnNotNull()

isColumnInPK

public boolean isColumnInPK()

getColumnTable

public RdbGenTable getColumnTable()

getColumnNotNull

public java.lang.String getColumnNotNull()

getColumnInPK

public java.lang.String getColumnInPK()

columnInPK

public boolean columnInPK()

getSqlType

public java.lang.String getSqlType(RdbAdapter adapter)
                            throws PException
Gets the SQL type associated with this column into the database for which we define the mapping.

Returns:
The string containing the name of the relevant SQL type.
Throws:
PException

getFieldVal

public java.lang.String getFieldVal(java.lang.String fieldval)

getSqlGet

public java.lang.String getSqlGet(java.lang.String resultset,
                                  int pos,
                                  RdbAdapter adapter)
                           throws PException
Constructs the string that defines the way to access to the relevant result part into a particular ResultSet.

Parameters:
resultset - The name of the ResultSet variable used to get the query result.
pos - The position of the result to get.
Returns:
The string defining the access to the relevant result part into a particular ResultSet.
Throws:
PException

getSqlSet

public java.lang.String getSqlSet(java.lang.String pstmt,
                                  int pos,
                                  RdbAdapter adapter)
                           throws PException
Constructs the string that defines the way to assign to the relevant query parameter into a particular prepared statement.

Parameters:
pstmt - The name of the PreparedStatement variable used to set the given query parameter.
pos - The position of the query parameter to be assigned.
Returns:
The string defining the assignement of the relevant query parameter into a particular PreparedStatement.
Throws:
PException

getSqlTypeCode

public int getSqlTypeCode(PType pt,
                          RdbAdapter adapter)
                   throws PException
Throws:
PException

getAccessorValue

public java.lang.String getAccessorValue(RdbGenInfos genInfos,
                                         boolean isSpecific)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

getAccessorValue

public java.lang.String getAccessorValue(RdbGenInfos genInfos,
                                         boolean isSpecific,
                                         RdbGenJoin rgj)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

getRefValue

public java.lang.String getRefValue(RdbGenInfos genInfos,
                                    boolean isSpecific)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getRefValue

public java.lang.String getRefValue(RdbGenInfos genInfos,
                                    boolean isSpecific,
                                    RdbGenJoin rgj)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getColumnName

public java.lang.String getColumnName(java.lang.String tableSuffix)

isInJoin

public boolean isInJoin(RdbGenJoin rgj)