pl.kernelpanic.dbmonster.schema
Class Column

java.lang.Object
  extended by pl.kernelpanic.dbmonster.schema.Column
All Implemented Interfaces:
Comparable

public class Column
extends Object
implements Comparable

The column.

Version:
$Id: Column.java,v 1.3 2006/01/05 16:29:37 majek Exp $
Author:
Piotr Maj <pm@jcake.com>

Constructor Summary
Column()
           
 
Method Summary
 int compareTo(Object o)
           
 void generate()
          Generates this column.
 boolean getDatabaseDefault()
          Returns true if this column should not be included in INSERT query allowing the database to put the default value for this column.
 DataGenerator getGenerator()
          Returns a data generator.
 String getName()
          Returns the name of the column.
 Table getTable()
          Returns a table.
 int getTargetType()
           
 Object getValue()
          Returns the value.
 void initialize(DBMonsterContext ctx)
          Initializes the column.
 void reset()
          Resets the column.
 void setDatabaseDefault(boolean isDatabaseDefault)
          Sets database default parameter
 void setGenerator(DataGenerator gen)
          Sets the data generator.
 void setName(String s)
          Sets the name of the column.
 void setTable(Table t)
          Sets the table.
 void setTargetType(int targetType)
           
 void setValue(Object o)
          Sets the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Column

public Column()
Method Detail

getName

public String getName()
Returns the name of the column.

Returns:
the name of the column.

setName

public void setName(String s)
Sets the name of the column.

Parameters:
s - the name of the column.

getGenerator

public DataGenerator getGenerator()
Returns a data generator.

Returns:
generator.

setGenerator

public void setGenerator(DataGenerator gen)
Sets the data generator.

Parameters:
gen - data generator

initialize

public void initialize(DBMonsterContext ctx)
                throws Exception
Initializes the column.

Parameters:
ctx - dbmonster context.
Throws:
Exception - if initialization fails

generate

public void generate()
              throws Exception
Generates this column.

Throws:
Exception - if this column could not be generated

reset

public void reset()
Resets the column.


getDatabaseDefault

public boolean getDatabaseDefault()
Returns true if this column should not be included in INSERT query allowing the database to put the default value for this column.

Returns:
defaultDatabase value

setDatabaseDefault

public void setDatabaseDefault(boolean isDatabaseDefault)
Sets database default parameter

Parameters:
isDatabaseDefault - true if DBMonster should use database default value.

setValue

public void setValue(Object o)
Sets the value.

Parameters:
o - the value

getValue

public Object getValue()
Returns the value.

Returns:
the value.

setTable

public void setTable(Table t)
Sets the table.

Parameters:
t - table

getTable

public Table getTable()
Returns a table.

Returns:
a table.

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

getTargetType

public int getTargetType()
Returns:
Returns the targetType.

setTargetType

public void setTargetType(int targetType)
Parameters:
targetType - The targetType to set.


Copyright © 2003-2006 .:. kernelpanic.pl .:.. All Rights Reserved.