org.gswing.components.input.dbcreator
Class DbField

java.lang.Object
  extended by org.gswing.components.input.dbcreator.DbField

public class DbField
extends Object

Purpose: Represents a database field.


Constructor Summary
DbField(String name, String type)
          Constructor.
DbField(String name, String type, boolean key)
          Constructor.
DbField(String name, String type, boolean primaryKey, boolean canBeNull)
          Constructor.
DbField(String name, String type, boolean primaryKey, boolean canBeNull, ForeignKey foreignKey)
          Constructor.
DbField(String name, String type, boolean primaryKey, ForeignKey foreignKey)
          Constructor.
DbField(String name, String type, ForeignKey foreignKey)
          Constructor.
 
Method Summary
 boolean canBeNull()
          Can this field be null?
 ForeignKey getForeignKey()
          Get the foreign key of the field.
 String getName()
          Get this field's name.
 String getType()
          Get this field's type.
 boolean isPrimaryKey()
          Is this field a primary key?.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbField

public DbField(String name,
               String type,
               boolean primaryKey,
               boolean canBeNull)
Constructor.

Parameters:
name - The field name.
type - The field type.
primaryKey - Is this field a primary key?.
canBeNull - Can this field be null?

DbField

public DbField(String name,
               String type,
               boolean key)
Constructor.

Parameters:
name - The field name.
type - The field type.
key - Is this field a primary key?.

DbField

public DbField(String name,
               String type,
               ForeignKey foreignKey)
Constructor.

Parameters:
name - The field name.
type - The field type.
foreignKey - The field foreign key.

DbField

public DbField(String name,
               String type,
               boolean primaryKey,
               ForeignKey foreignKey)
Constructor.

Parameters:
name - The field name.
type - The field type.
primaryKey - Is this a primary key?
foreignKey - The field foreign key.

DbField

public DbField(String name,
               String type,
               boolean primaryKey,
               boolean canBeNull,
               ForeignKey foreignKey)
Constructor.

Parameters:
name - The field name.
type - The field type.
primaryKey - Is this field a primary key?
canBeNull - Can this field be null?
foreignKey - The field foreign key.

DbField

public DbField(String name,
               String type)
Constructor.

Parameters:
name - The field name.
type - The field type.
Method Detail

getName

public String getName()
Get this field's name.

Returns:
The field name.

getType

public String getType()
Get this field's type.

Returns:
The field type.

isPrimaryKey

public boolean isPrimaryKey()
Is this field a primary key?.

Returns:
True if this field is a primary key.

canBeNull

public boolean canBeNull()
Can this field be null?

Returns:
Returns true if this field can be null.

getForeignKey

public ForeignKey getForeignKey()
Get the foreign key of the field.

Returns:
The foreign key. Return null if not defined.


Copyright © 2008. All Rights Reserved.