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

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

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsDBCreateStatementColumnSqlType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsDBCreateStatementColumnSqlType

public class TLptsDBCreateStatementColumnSqlType
extends XLptsDBCreateStatementColumnSqlType

Class Description : Initialises the SQL type of the CREATE statement column type.

Use this as per the examples below.

$LastChangedRevision: 947 $
$LastChangedDate:: 2010-07-26 09:08:35#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBCreateStatementColumnSqlType
sqlType
 
Constructor Summary
TLptsDBCreateStatementColumnSqlType(TLptsDBCreateStatementColumnType col)
           This constructor initiates the Column SQL Type.
TLptsDBCreateStatementColumnSqlType(XLptsDBCreateStatementColumnSqlType ccst)
           This constructor copies the SQL Type from an existing XLptsDBCreateStatementColumnSqlType.
 
Method Summary
 TLptsDBCreateStatementColumnType getColumn()
           Gets the TLptsDBCreateStatementColumnType of this TLptsDBCreateStatementColumnSqlType.
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBCreateStatementColumnSqlType
getSqlType, setSqlType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsDBCreateStatementColumnSqlType

public TLptsDBCreateStatementColumnSqlType(TLptsDBCreateStatementColumnType col)

This constructor initiates the Column SQL Type.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes :
Default Constructor initiates the SQL type to java.sql.Types.INTEGER and sets the column for convenient programming.

Example :


    TLptsStatement createStatement = new TLptsStatement(connection,XLptsDBTypeOfStatementType.CREATE);
    ...
    //Create the columns
    TLptsDBCreateStatementColumnType idColumn = new TLptsDBCreateStatementColumnType();
    //Set the column name
    idColumn.setColumn("id");
    ...
    //Set the column sql type
    TLptsDBCreateStatementColumnSqlType sqlType = new TLptsDBCreateStatementColumnSqlType(idColumn);
    sqlType.setSqlType(java.sql.Types.INTEGER);
    idColumn.setSqlType(sqlType);
    ...
 }
 

Parameters:
col - the column that relates to this type.

TLptsDBCreateStatementColumnSqlType

public TLptsDBCreateStatementColumnSqlType(XLptsDBCreateStatementColumnSqlType ccst)

This constructor copies the SQL Type from an existing XLptsDBCreateStatementColumnSqlType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes :
Use this function every time you need to copy or instantiate a type XLptsDBCreateStatementColumnSqlType class.

Example :


 public void example(XLptsDBCreateStatementColumnSqlType ccst)
 {
   TLptsDBCreateStatementColumnSqlType sqlType = new TLptsDBCreateStatementColumnSqlType(ccst);
 }
 

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

getColumn

public TLptsDBCreateStatementColumnType getColumn()

Gets the TLptsDBCreateStatementColumnType of this TLptsDBCreateStatementColumnSqlType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this for convenience sake.

Example :

 ...
 private void setColumnSizeByType(TLptsDBCreateStatementColumnSqlType value)
 {
  if(value.getSqlType()==java.sql.Types.VARCHAR)
     value.getColumn().getSizes().setSize1("50");
  else if(value.getColumn().getSqlType().getSqlType()==java.sql.Types.DECIMAL)
     value.getColumn().getSizes().setSize1("10");
 }
 

Returns:
the TLptsDBCreateStatementColumnType of this sqlType


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