org.apache.torque.om
Class StringKey

java.lang.Object
  extended by org.apache.torque.om.ObjectKey
      extended by org.apache.torque.om.SimpleKey
          extended by org.apache.torque.om.StringKey
All Implemented Interfaces:
Serializable, Comparable<Object>

public class StringKey
extends SimpleKey

This class can be used as an ObjectKey to uniquely identify an object within an application where the id consists of a single entity such a GUID or the value of a db row's primary key.

Version:
$Id: StringKey.java 1351125 2012-06-17 16:51:03Z tv $
Author:
John McNally
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.torque.om.ObjectKey
key
 
Constructor Summary
StringKey()
          Creates an SimpleKey whose internal representation will be set later, through a set method
StringKey(String key)
          Creates a StringKey whose internal representation is a String
StringKey(StringKey key)
          Creates a StringKey that is equivalent to key.
 
Method Summary
 int getJdbcType()
          Returns the JDBC type of the key as defined in java.sql.Types.
 String getString()
          Access the underlying String object.
 void setValue(String key)
          Sets the internal representation to a String
 void setValue(StringKey key)
          Sets the internal representation to the same object used by key.
 String toString()
          Get a String representation of this key.
 
Methods inherited from class org.apache.torque.om.SimpleKey
keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor
 
Methods inherited from class org.apache.torque.om.ObjectKey
appendTo, compareTo, equals, getValue, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringKey

public StringKey()
Creates an SimpleKey whose internal representation will be set later, through a set method


StringKey

public StringKey(String key)
Creates a StringKey whose internal representation is a String

Parameters:
key - the key value

StringKey

public StringKey(StringKey key)
Creates a StringKey that is equivalent to key.

Parameters:
key - the key value
Method Detail

setValue

public void setValue(String key)
Sets the internal representation to a String

Specified by:
setValue in class ObjectKey
Parameters:
key - the key value

setValue

public void setValue(StringKey key)
Sets the internal representation to the same object used by key.

Parameters:
key - the key value

getString

public String getString()
Access the underlying String object.

Returns:
a String value

getJdbcType

public int getJdbcType()
Returns the JDBC type of the key as defined in java.sql.Types.

Specified by:
getJdbcType in class ObjectKey
Returns:
Types.VARCHAR.

toString

public String toString()
Get a String representation of this key.

Overrides:
toString in class Object
Returns:
a String representation of this key, or an empty String if the value is null.


Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.