ThinkUI SQL Client 1.1.3 API

thinkui.db
Class PrimaryKey

java.lang.Object
  extended bythinkui.db.PrimaryKey
All Implemented Interfaces:
java.io.Serializable

public class PrimaryKey
extends java.lang.Object
implements java.io.Serializable

Encapsulates the primary key for a data object.

See Also:
Serialized Form

Constructor Summary
PrimaryKey(java.lang.Object[][] attrNameValues)
          PrimaryKey constructor.
PrimaryKey(java.lang.String[] attrNames, java.lang.Object[] values)
          PrimaryKey constructor.
PrimaryKey(java.lang.String attrName, java.lang.Object value)
          PrimaryKey constructor.
 
Method Summary
 java.lang.String encode()
          This method returns the primary key as a string representation suitable for display.
 boolean equals(java.lang.Object object)
          Two primary keys are equal if they have exactly the same attribute names and values.
 java.lang.String[] getAttrNames()
           
 java.lang.Object getValue(java.lang.String attrName)
           
 java.lang.Object[] getValues()
           
 int hashCode()
           
 boolean isAttribute(java.lang.String attrName)
           
 boolean isValid()
          Check that the primary key consists of at least one attribute, has the same number of attribute names and values, and none of the values are null.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrimaryKey

public PrimaryKey(java.lang.Object[][] attrNameValues)
PrimaryKey constructor.


PrimaryKey

public PrimaryKey(java.lang.String[] attrNames,
                  java.lang.Object[] values)
PrimaryKey constructor.


PrimaryKey

public PrimaryKey(java.lang.String attrName,
                  java.lang.Object value)
PrimaryKey constructor.

Method Detail

encode

public final java.lang.String encode()
This method returns the primary key as a string representation suitable for display.

Returns:
the primary key as a string representation suitable for display.

equals

public boolean equals(java.lang.Object object)
Two primary keys are equal if they have exactly the same attribute names and values.

Returns:
whether or not the specified object is equals to this object.

getAttrNames

public final java.lang.String[] getAttrNames()

getValue

public final java.lang.Object getValue(java.lang.String attrName)

getValues

public final java.lang.Object[] getValues()

hashCode

public final int hashCode()
Returns:
the hash code of the primary key.

isAttribute

public boolean isAttribute(java.lang.String attrName)
Returns:
whether or not the specified attribute name is valid.

isValid

public final boolean isValid()
Check that the primary key consists of at least one attribute, has the same number of attribute names and values, and none of the values are null.

Returns:
whether or not all the values in the primary key is not null.

toString

public final java.lang.String toString()

ThinkUI SQL Client 1.1.3 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.