easik.sketch.util.Export.Components
Class ExportUniqueKey

java.lang.Object
  extended by easik.sketch.util.Export.Components.ExportUniqueKey

public class ExportUniqueKey
extends java.lang.Object

A class to hold the elements of a unique key. Elements are stored as a linked list of names of attributes which constitute the unique key. This class should only be used for SQL database generation as it does not contain full functionality.

Since:
2006-06-14 Vera Ranieri
Version:
2006-06-14 Vera Ranieri
Author:
Vera Ranieri 2006

Field Summary
private  java.util.LinkedList<java.lang.String> _elements
          The attributes involved in the unique key
 
Constructor Summary
ExportUniqueKey()
          Constructor.
 
Method Summary
 void addElement(java.lang.String e)
          Adds a new element to the unique key by adding the name of the attribute that is part of the unique key to the list of all elements which form the unique key.
 java.util.LinkedList getElements()
          Getter method for the linked list of all names of attributes which form this unique key
static java.lang.String getUniqueKeyString(ExportTable t)
          Formats the unique key string for SQL exportation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_elements

private java.util.LinkedList<java.lang.String> _elements
The attributes involved in the unique key

Constructor Detail

ExportUniqueKey

public ExportUniqueKey()
Constructor. Initializes elements

Method Detail

addElement

public void addElement(java.lang.String e)
Adds a new element to the unique key by adding the name of the attribute that is part of the unique key to the list of all elements which form the unique key.

Parameters:
e - The name of the element which forms a part of the unique key

getElements

public java.util.LinkedList getElements()
Getter method for the linked list of all names of attributes which form this unique key

Returns:
The linked list of all attributes which form this key

getUniqueKeyString

public static java.lang.String getUniqueKeyString(ExportTable t)
Formats the unique key string for SQL exportation. The table t passed to the method is the table for which unique keys must be determined. Does not contain relevant information about key definition and primary key definition

Parameters:
t - The table for which unique keys must be determined
Returns:
The unique key string formatted for SQL