DBVIEW
org.dbview.db.structure.Field Class Reference
Collaboration diagram for org.dbview.db.structure.Field:

List of all members.

Public Member Functions

DeadForeignKey getDeadForeignKey () throws org.dbview.db.structure.FieldException
void isASoftForeignKey ()
void isAHardForeignKey ()
Boolean isSoftForeignKey ()
Boolean isHardForeignKey ()
void setIndexName (String in_index_name)
String getIndexName ()
 Field (Table in_table, String in_name) throws org.dbview.db.structure.TableException
void isANull ()
void isAPrimaryKey ()
void isAforeignKey (Field in_reference) throws org.dbview.db.structure.FieldException
void isADeadforeignKey (String in_reference_table, String in_reference_field) throws org.dbview.db.structure.FieldException
void isAUniqueIndex ()
void isAMultipleIndex ()
Field getFkToMe ()
String getName ()
String getFullName ()
Field getReference () throws org.dbview.db.structure.FieldException
Table getTable ()
String getTableName ()
Boolean isPrimaryKey ()
Boolean isForeignKey ()
Boolean isDeadForeignKey ()
Boolean isKey ()
Boolean isUniqueIndex ()
Boolean isUnique ()
Boolean isMultipleIndex ()
Boolean isIndex ()
Boolean isNull ()
String toString ()

Static Package Attributes

static final int NOT_INDEX = 0
static final int NOT_KEY = 0
static final int MULTIPLE_INDEX = 1
static final int UNIQUE_INDEX = 2
static final int KEY_FOREIGN = 1
static final int KEY_PRIMRY = 2
static final int KEY_DEAD_FOREIGN = 3
static final int NOT_NULL = 0
static final int CAN_BE_NULL = 1

Private Attributes

Table __table = null
String __name = null
String __index_name = null
int __key = Field.NOT_KEY
int __index = Field.NOT_INDEX
int __null = Field.NOT_NULL
Field __reference = null
Field __fk = null
Boolean __fk_hard = Boolean.TRUE
DeadForeignKey __dead_reference = null

Detailed Description

This class represents a table's field.

Author:
Denis Beurive

Definition at line 31 of file Field.java.


Constructor & Destructor Documentation

org.dbview.db.structure.Field.Field ( Table  in_table,
String  in_name 
) throws org.dbview.db.structure.TableException

Create a field, and add the field to a table.

Parameters:
in_tableTable that contains this field.
in_nameName of the field.
Exceptions:
org.dbview.db.structure.TableException

Definition at line 178 of file Field.java.


Member Function Documentation

DeadForeignKey org.dbview.db.structure.Field.getDeadForeignKey ( ) throws org.dbview.db.structure.FieldException

Assuming that this field is a dead foreign key, then the method returns the dead foreign key's reference.

Returns:
If this field is a dead foreign key, then the method returns its reference.

Definition at line 112 of file Field.java.

Field org.dbview.db.structure.Field.getFkToMe ( )

If the field is a "reference" for a foreign key, then the method returns the foreign key.

Returns:
If the field is a "reference" for a foreign key, then the method returns the foreign key. Otherwise, the method returns the value null.

Definition at line 265 of file Field.java.

String org.dbview.db.structure.Field.getFullName ( )

This method returns the full name of the field. The full name includes the table's name.

Returns:
The method returns the full name of the field.

Definition at line 283 of file Field.java.

Referenced by org.dbview.db.structure.Field.getDeadForeignKey(), and org.dbview.db.structure.Field.toString().

String org.dbview.db.structure.Field.getIndexName ( )

Return the name of the index that uses this field.

Returns:
The method returns the name of the index that uses this field.

Definition at line 167 of file Field.java.

String org.dbview.db.structure.Field.getName ( )

Return the name of the field.

Returns:
The method returns the name of the field.

Definition at line 274 of file Field.java.

Referenced by org.dbview.databaseExporters.dot.DotFull.__createIndexLabel().

Field org.dbview.db.structure.Field.getReference ( ) throws org.dbview.db.structure.FieldException

Return the field's "reference" (if the field is a foreign key).

Returns:
The method returns the field's "reference".
Exceptions:
org.dbview.db.structure.FieldException

Definition at line 293 of file Field.java.

Referenced by org.dbview.db.structure.Database.__getRelationsFromTable().

Table org.dbview.db.structure.Field.getTable ( )

Return the table that contains this field.

Returns:
The method returns the table that contains "this" field.

Definition at line 304 of file Field.java.

Referenced by org.dbview.db.structure.Database.__getRelationsFromTable().

String org.dbview.db.structure.Field.getTableName ( )

This method returns the name of the field's table.

Returns:
The method returns the name of the field's table.

Definition at line 313 of file Field.java.

void org.dbview.db.structure.Field.isADeadforeignKey ( String  in_reference_table,
String  in_reference_field 
) throws org.dbview.db.structure.FieldException

Set the field a "dead" foreign key.

Parameters:
in_reference_tableName of the reference table.
in_reference_fieldName of the reference field.

Definition at line 230 of file Field.java.

void org.dbview.db.structure.Field.isAforeignKey ( Field  in_reference) throws org.dbview.db.structure.FieldException

Set the field a foreign key.

Parameters:
in_reference"Reference" field.

Definition at line 205 of file Field.java.

void org.dbview.db.structure.Field.isAHardForeignKey ( )

This method is used to specify that a foreign key is a hard one.

Remarks:
A hard foreign key defines a hard join. A hard join is defined by the table's constraint.

Definition at line 131 of file Field.java.

void org.dbview.db.structure.Field.isAMultipleIndex ( )

Set the field a multiple index.

Definition at line 255 of file Field.java.

void org.dbview.db.structure.Field.isANull ( )

Set the field "can be NULL".

Definition at line 188 of file Field.java.

void org.dbview.db.structure.Field.isAPrimaryKey ( )

Set the field a primary key.

Definition at line 196 of file Field.java.

void org.dbview.db.structure.Field.isASoftForeignKey ( )

This method is used to specify that a foreign key is a soft one.

Remarks:
A soft foreign key defines a soft join. A soft join is defined by foreign keys' names only. You can find this type of joins in MyIsam (MySql) tables, for example.

Definition at line 122 of file Field.java.

void org.dbview.db.structure.Field.isAUniqueIndex ( )

Set the field a unique index.

Definition at line 247 of file Field.java.

Boolean org.dbview.db.structure.Field.isDeadForeignKey ( )

Test if the field is a dead foreign key.

Returns:
The method returns the value TRUE if the field is a dead foreign key. Otherwise the method returns the value FALSE.

Definition at line 343 of file Field.java.

Referenced by org.dbview.db.structure.Field.getDeadForeignKey(), and org.dbview.db.structure.Field.toString().

Boolean org.dbview.db.structure.Field.isForeignKey ( )

Test if the field is a foreign key.

Returns:
The method returns the value TRUE if the field is a foreign key. Otherwise the method returns the value FALSE.

Definition at line 333 of file Field.java.

Referenced by org.dbview.db.structure.Field.toString().

Boolean org.dbview.db.structure.Field.isHardForeignKey ( )

Test if a foreign key is hard.

Returns:
The method returns the value TRUE if the foreign key is hard.

Definition at line 149 of file Field.java.

Boolean org.dbview.db.structure.Field.isIndex ( )

Test if the field is an index.

Returns:
The method returns the value TRUE if the field is an index. Otherwise the method returns the value FALSE.

Definition at line 395 of file Field.java.

Boolean org.dbview.db.structure.Field.isKey ( )

Test if the field is a key (primary or foreign).

Returns:
The method returns the value TRUE if the field is a key. Otherwise the method returns the value FALSE.

Definition at line 353 of file Field.java.

Boolean org.dbview.db.structure.Field.isMultipleIndex ( )

Test if the field is a multiple index.

Returns:
The method returns the value TRUE if the field is a multiple index. Otherwise the method returns the value FALSE.

Definition at line 385 of file Field.java.

Referenced by org.dbview.db.structure.Field.toString().

Boolean org.dbview.db.structure.Field.isNull ( )

Test if the field can be null.

Returns:
The method returns the value TRUE if the field can be null.

Definition at line 406 of file Field.java.

Referenced by org.dbview.db.structure.Database.__getRelationsFromTable().

Boolean org.dbview.db.structure.Field.isPrimaryKey ( )

Test if the field is a primary key.

Returns:
The method returns the value TRUE if the field is a primary key. Otherwise the method returns the value FALSE.

Definition at line 323 of file Field.java.

Referenced by org.dbview.db.structure.Field.toString().

Boolean org.dbview.db.structure.Field.isSoftForeignKey ( )

Test if a foreign key is soft.

Returns:
The method returns the value TRUE if the foreign key is soft.

Definition at line 140 of file Field.java.

Boolean org.dbview.db.structure.Field.isUnique ( )

Test if the field has a unique constraint.

Returns:
The method returns the value TRUE if the field is a unique constraint. Otherwise the method returns the value FALSE.

Definition at line 375 of file Field.java.

Referenced by org.dbview.db.structure.Database.__getRelationsFromTable().

Boolean org.dbview.db.structure.Field.isUniqueIndex ( )

Test if the field is a unique index.

Returns:
The method returns the value TRUE if the field is a unique index. Otherwise the method returns the value FALSE.

Definition at line 365 of file Field.java.

Referenced by org.dbview.db.structure.Field.isUnique(), and org.dbview.db.structure.Field.toString().

void org.dbview.db.structure.Field.setIndexName ( String  in_index_name)

Set the name of the index that uses this field.

Parameters:
in_index_nameName of the index.

Definition at line 158 of file Field.java.

String org.dbview.db.structure.Field.toString ( )

Create a textual representation of the field.

Returns:
The method returns a textual representation of the field.

Definition at line 415 of file Field.java.

Referenced by org.dbview.db.structure.Table.toString().


Member Data Documentation

If the field is a "dead" foreign key (type IFieldTypes.DEAD_FOREIGN_KEY), then his member represents the "dead" field's "reference".

Definition at line 106 of file Field.java.

Referenced by org.dbview.db.structure.Field.getDeadForeignKey(), org.dbview.db.structure.Field.isADeadforeignKey(), and org.dbview.db.structure.Field.toString().

If this field is a "reference" for a foreign key, then this field represents the foreign key.

Definition at line 100 of file Field.java.

Referenced by org.dbview.db.structure.Field.getFkToMe(), org.dbview.db.structure.Field.isAforeignKey(), and org.dbview.db.structure.Field.toString().

Boolean org.dbview.db.structure.Field.__fk_hard = Boolean.TRUE [private]

If the field is a foreign key, then this attribute tells whether the field is a "hard" (as opposed to "soft") foreign key or not.

Definition at line 103 of file Field.java.

Referenced by org.dbview.db.structure.Field.isAHardForeignKey(), org.dbview.db.structure.Field.isASoftForeignKey(), org.dbview.db.structure.Field.isHardForeignKey(), and org.dbview.db.structure.Field.isSoftForeignKey().

Name of the index that uses this field.

Definition at line 85 of file Field.java.

Referenced by org.dbview.db.structure.Field.getIndexName(), and org.dbview.db.structure.Field.setIndexName().

Can the field be null?

Definition at line 94 of file Field.java.

Referenced by org.dbview.db.structure.Field.isANull(), and org.dbview.db.structure.Field.isNull().

If the field is a foreign key (type IFieldTypes.FOREIGN_KEY), then his member represents the field's "reference".

Definition at line 97 of file Field.java.

Referenced by org.dbview.db.structure.Field.getReference(), org.dbview.db.structure.Field.isAforeignKey(), and org.dbview.db.structure.Field.toString().

final int org.dbview.db.structure.Field.CAN_BE_NULL = 1 [static, package]

This constant is used to say that a field can be null.

Definition at line 76 of file Field.java.

Referenced by org.dbview.db.structure.Field.isANull(), and org.dbview.db.structure.Field.isNull().

final int org.dbview.db.structure.Field.KEY_DEAD_FOREIGN = 3 [static, package]

This constant is used to say that a field is a "dead" foreign key.

Definition at line 66 of file Field.java.

Referenced by org.dbview.db.structure.Field.isADeadforeignKey(), and org.dbview.db.structure.Field.isDeadForeignKey().

final int org.dbview.db.structure.Field.KEY_PRIMRY = 2 [static, package]

This constant is used to say that a field is a primary index.

Definition at line 61 of file Field.java.

Referenced by org.dbview.db.structure.Field.isAPrimaryKey(), org.dbview.db.structure.Field.isKey(), and org.dbview.db.structure.Field.isPrimaryKey().

final int org.dbview.db.structure.Field.MULTIPLE_INDEX = 1 [static, package]

This constant is used to say that a field is a multiple index.

Definition at line 46 of file Field.java.

Referenced by org.dbview.db.structure.Field.isAMultipleIndex(), org.dbview.db.structure.Field.isIndex(), and org.dbview.db.structure.Field.isMultipleIndex().

final int org.dbview.db.structure.Field.NOT_INDEX = 0 [static, package]

This constant is used to say that a field is not an index.

Definition at line 36 of file Field.java.

final int org.dbview.db.structure.Field.NOT_KEY = 0 [static, package]

This constant is used to say that a field is not a key.

Definition at line 41 of file Field.java.

final int org.dbview.db.structure.Field.NOT_NULL = 0 [static, package]

This constant is used to say that a field can not be null.

Definition at line 71 of file Field.java.

final int org.dbview.db.structure.Field.UNIQUE_INDEX = 2 [static, package]

This constant is used to say that a field is a unique index.

Definition at line 51 of file Field.java.

Referenced by org.dbview.db.structure.Field.isAUniqueIndex(), org.dbview.db.structure.Field.isIndex(), and org.dbview.db.structure.Field.isUniqueIndex().


The documentation for this class was generated from the following file: