Package org.apache.torque.om
Klasse ComboKey
- Alle implementierten Schnittstellen:
Serializable
,Comparable<Object>
This class can be used as an ObjectKey to uniquely identify an
object within an application where the key consists of multiple
entities (such a String[] representing a multi-column primary key).
- Version:
- $Id: ComboKey.java 1917245 2024-04-21 14:06:23Z tv $
- Autor:
- John McNally, Daniel Rall, J. Russell Smyth
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final char
The single character used to separate key values in a string.static final String
The single character used to separate key values in a string. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungComboKey()
Initializes the internal key value tonull
.Creates an ComboKey and set its internal representationCreates a ComboKey that is equivalent to key.Creates an ComboKey and set its internal representation -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Appends a String representation of the key to a buffer.boolean
This method will return true if the conditions for a looseEquals are met and in addition no parts of the keys are null.int
Returns the JDBC type of the key as defined injava.sql.Types
.int
hashCode()
if the underlying key array is not null and the first element is not null this method returns the hashcode of the first element in the key.boolean
looseEquals
(Object keyObj) keyObj is equal to this ComboKey if keyObj is a ComboKey, String, ObjectKey[], or String[] that contains the same information this key contains.void
Sets the internal representation using a String of the form produced by the toString method.toString()
A String that may consist of one section or multiple sections separated by a colon.
-
Felddetails
-
SEPARATOR
public static final char SEPARATORThe single character used to separate key values in a string.- Siehe auch:
-
SEPARATOR_STRING
The single character used to separate key values in a string.- Siehe auch:
-
-
Konstruktordetails
-
ComboKey
public ComboKey()Initializes the internal key value tonull
. -
ComboKey
Creates an ComboKey and set its internal representation- Parameter:
key
- the key value as String
-
ComboKey
Creates an ComboKey and set its internal representation- Parameter:
key
- the key value
-
ComboKey
Creates a ComboKey that is equivalent to key.- Parameter:
key
- the key value
-
-
Methodendetails
-
setValue
Sets the internal representation using a String of the form produced by the toString method.- Parameter:
keys
- the key values
-
getJdbcType
public int getJdbcType()Returns the JDBC type of the key as defined injava.sql.Types
.- Angegeben von:
getJdbcType
in KlasseObjectKey<SimpleKey<?>[]>
- Gibt zurück:
Types.ARRAY
.
-
equals
This method will return true if the conditions for a looseEquals are met and in addition no parts of the keys are null. -
looseEquals
keyObj is equal to this ComboKey if keyObj is a ComboKey, String, ObjectKey[], or String[] that contains the same information this key contains. For example A String[] might be equal to this key, if this key was instantiated with a String[] and the arrays contain equal Strings. Another example, would be if keyObj is an ComboKey that was instantiated with a ObjectKey[] and this ComboKey was instantiated with a String[], but the ObjectKeys in the ObjectKey[] were instantiated with Strings that equal the Strings in this KeyObject's String[] This method is not as strict as the equals method which does not allow any null keys parts, while the internal key may not be null portions may be, and the two object will be considered equal if their null portions match.- Parameter:
keyObj
- the comparison value- Gibt zurück:
- whether the two objects are equal
-
appendTo
Beschreibung aus Klasse kopiert:ObjectKey
Appends a String representation of the key to a buffer. -
hashCode
public int hashCode()if the underlying key array is not null and the first element is not null this method returns the hashcode of the first element in the key. Otherwise calls ObjectKey.hashCode() -
toString
A String that may consist of one section or multiple sections separated by a colon.Each Key is represented by
[type N|S|D][value][:]
.Example:
the ComboKey(StringKey("key1"), NumberKey(2)) is represented as
Skey1:N2:
-