Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.xml.types
Class TLptsDBStatementColumnType

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsDBStatementColumnType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsDBStatementColumnType

public class TLptsDBStatementColumnType
extends XLptsDBStatementColumnType

Class Description : Initialises the column type of the statement (for SELECT).

Because the columns and tables are utilised in a flat fashion in STATEMENTS, there is no hierarchy (table-column, one to many).
So therefore the columns need to keep information as to the table they belong to. This is kept in the form of a table name and unique id.
The rest of the information in this class directly related to the column type and parameters for INSERT, UPDATE and DELETE commands.

This structure is used by TLptsStatement to store all the columns in a list after connection.
The list contains both selected and unselected columns (same for the tables in their list) from the database.

$LastChangedRevision: 1165 $
$LastChangedDate:: 2010-11-03 10:37:03#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBStatementColumnType
allSelected, columnName, id, selected, sqlSubstitutedType, sqlType, tableId, tableName, upInsDelParameterItem
 
Constructor Summary
TLptsDBStatementColumnType()
           This constructor initiates a Statement Column.
TLptsDBStatementColumnType(java.lang.String tableId, java.lang.String table, java.lang.String column, int type)
           This constructor sets the Column values from arguments.
TLptsDBStatementColumnType(XLptsDBStatementColumnType sct)
           This constructor copies the column information from an existing XLptsDBStatementColumnType.
 
Method Summary
 boolean equals(java.lang.Object obj)
           Checks for equality with another TLptsStatementsColumnType object.
 TLptsDBStatementColumnType getCopy()
           Returns an identical copy of the TLptsDBStatementColumnType.
 void setUpInsDelParameterItem(XLptsDBUpInsDelType upInsDelParameterItem)
          Sets the value of the upInsDelParameterItem property.
 java.lang.String toString()
           Returns the columns name.
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBStatementColumnType
getColumnName, getId, getSqlSubstitutedType, getSqlType, getTableId, getTableName, getUpInsDelParameterItem, isAllSelected, isSelected, setAllSelected, setColumnName, setId, setSelected, setSqlSubstitutedType, setSqlType, setTableId, setTableName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TLptsDBStatementColumnType

public TLptsDBStatementColumnType()

This constructor initiates a Statement Column.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : The default sql type is set to VARCHAR.

Example :

 


TLptsDBStatementColumnType

public TLptsDBStatementColumnType(java.lang.String tableId,
                                  java.lang.String table,
                                  java.lang.String column,
                                  int type)

This constructor sets the Column values from arguments.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes :
This is used by dbJAPI to set the column data from the connection. This also correlates the column to a table.

Example :

 

Parameters:
tableId - column's table id.
table - column's table name.
column - is the column name.
type - is the SQL type.

TLptsDBStatementColumnType

public TLptsDBStatementColumnType(XLptsDBStatementColumnType sct)

This constructor copies the column information from an existing XLptsDBStatementColumnType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : This is used by the project manager after loading a XLptsDBStatementColumnType from an XML file.

Example :

 

Parameters:
sct - the class object to copy.
Method Detail

equals

public boolean equals(java.lang.Object obj)

Checks for equality with another TLptsStatementsColumnType object.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes :

Example :

 

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Statement Column Type
Returns:
true if they are equal, else false.

getCopy

public TLptsDBStatementColumnType getCopy()

Returns an identical copy of the TLptsDBStatementColumnType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this function if you want to get an identical column.

Example :


 TLptsStatementsColumnType column = new TLptsStatementsColumnType();
 LinkedList  newColumnList = new LinkedList();
 newColumnList.add(column.getCopy);

 


setUpInsDelParameterItem

public void setUpInsDelParameterItem(XLptsDBUpInsDelType upInsDelParameterItem)
Description copied from class: XLptsDBStatementColumnType
Sets the value of the upInsDelParameterItem property.

Overrides:
setUpInsDelParameterItem in class XLptsDBStatementColumnType
Parameters:
upInsDelParameterItem - allowed object is XLptsDBUpInsDelType

toString

public java.lang.String toString()

Returns the columns name.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this function if you want to get column name.

Example :


 TLptsStatementsColumnType column = new TLptsStatementsColumnType();
 private void printColumnName(TLptsStatementsColumnType column)
 {
    System.out.println(column.toString);
    System.out.println(column.getColumnName());
 }

 Result : "First Name"
 Result : "First Name"
 

Overrides:
toString in class java.lang.Object


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)