pl.kernelpanic.dbmonster.schema
Class Key

java.lang.Object
  extended bypl.kernelpanic.dbmonster.schema.Key

public class Key
extends Object

The primary key.

Version:
$Id: Key.html,v 1.1 2007/06/21 08:38:14 sbahloul Exp $
Author:
Piotr Maj <piotr.maj@kernelpanic.pl>

Constructor Summary
Key()
           
 
Method Summary
 List generate()
          Generates the key.
 boolean getDatabaseDefault()
          Returns true if this key should not be included in INSERT query allowing the database to put the default value for this column(s).
 KeyGenerator getGenerator()
          Returns a generator.
 Table getTable()
          Returns a table.
 void initialize(DBMonsterContext ctx)
          Initializes the key.
 void setDatabaseDefault(boolean isDatabaseDefault)
          Sets database default parameter
 void setGenerator(KeyGenerator gen)
          Sets the generator.
 void setTable(Table t)
          Sets the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Key

public Key()
Method Detail

getGenerator

public final KeyGenerator getGenerator()
Returns a generator.

Returns:
generator.

setGenerator

public final void setGenerator(KeyGenerator gen)
Sets the generator.

Parameters:
gen - generator

initialize

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

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

generate

public final List generate()
                    throws Exception
Generates the key.

Returns:
List a list of columns.
Throws:
Exception - if generation fails

setTable

public final void setTable(Table t)
Sets the table.

Parameters:
t - table

getTable

public final Table getTable()
Returns a table.

Returns:
a table.

getDatabaseDefault

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

Returns:
defaultDatabase value

setDatabaseDefault

public final void setDatabaseDefault(boolean isDatabaseDefault)
Sets database default parameter

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


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