org.jpox.metadata
Class IdentityStrategy

java.lang.Object
  extended byorg.jpox.metadata.IdentityStrategy
All Implemented Interfaces:
java.io.Serializable

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

Representation of the values for identity "strategy".

Since:
1.1
Version:
$Revision: 1.11 $
See Also:
Serialized Form

Field Summary
static IdentityStrategy AUID
          strategy="auid" The value "auid" specifies a strategy that creates a pure UUID identity using the OpenGroup specification for UUID.
static IdentityStrategy AUTOASSIGN
          strategy="autoassign" The value "autoassign" specifies that the column identified as the key column is managed by the database to automatically increment key values.
static IdentityStrategy CUSTOM
          strategy="custom" The value "custom" specifies a strategy that uses a user own generator class.
static IdentityStrategy IDENTITY
          strategy="identity" The value "identity" specifies that the column identified as the key column is managed by the database as an autoincrementing identity type.
static IdentityStrategy INCREMENT
          strategy="increment" The value "increment" specifies a strategy that simply finds the largest key already in the database and increments the key value for new instances.
static IdentityStrategy MAX
          strategy="max" The value "max" specifies a strategy that simply finds the maximum for a column and increments the value by 1.
static IdentityStrategy NATIVE
          strategy="native" The value "native" allows the JDO implementation to pick the most suitable strategy based on the underlying database.
static IdentityStrategy SEQUENCE
          strategy="sequence" The value "sequence" specifies that a named database sequence is used to generate key values for the table.
static IdentityStrategy UUIDHEX
          strategy="uuid-hex" The value "uuid-hex" specifies a strategy that generates a 128-bit UUID unique within a network (the IP address of the machine running the application is part of the id) and represents the result as a 32-character String.
static IdentityStrategy UUIDSTRING
          strategy="uuid-string" The value "uuid-string" specifies a strategy that generates a 128-bit UUID unique within a network (the IP address of the machine running the application is part of the id) and represents the result as a 16-character String.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
static IdentityStrategy getIdentityStrategy(java.lang.String value)
          Gets an IdentityStrategy for the given value argument.
 int getType()
          Accessor for the type.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NATIVE

public static final IdentityStrategy NATIVE
strategy="native" The value "native" allows the JDO implementation to pick the most suitable strategy based on the underlying database.


SEQUENCE

public static final IdentityStrategy SEQUENCE
strategy="sequence" The value "sequence" specifies that a named database sequence is used to generate key values for the table. If sequence is used, then the sequence-name attribute is required.


AUTOASSIGN

public static final IdentityStrategy AUTOASSIGN
strategy="autoassign" The value "autoassign" specifies that the column identified as the key column is managed by the database to automatically increment key values.


IDENTITY

public static final IdentityStrategy IDENTITY
strategy="identity" The value "identity" specifies that the column identified as the key column is managed by the database as an autoincrementing identity type.


INCREMENT

public static final IdentityStrategy INCREMENT
strategy="increment" The value "increment" specifies a strategy that simply finds the largest key already in the database and increments the key value for new instances. It can be used with integral column types when the JDO application is the only database user inserting new instances.


UUIDSTRING

public static final IdentityStrategy UUIDSTRING
strategy="uuid-string" The value "uuid-string" specifies a strategy that generates a 128-bit UUID unique within a network (the IP address of the machine running the application is part of the id) and represents the result as a 16-character String.


UUIDHEX

public static final IdentityStrategy UUIDHEX
strategy="uuid-hex" The value "uuid-hex" specifies a strategy that generates a 128-bit UUID unique within a network (the IP address of the machine running the application is part of the id) and represents the result as a 32-character String.


MAX

public static final IdentityStrategy MAX
strategy="max" The value "max" specifies a strategy that simply finds the maximum for a column and increments the value by 1. Similar to the "identity" strategy.


AUID

public static final IdentityStrategy AUID
strategy="auid" The value "auid" specifies a strategy that creates a pure UUID identity using the OpenGroup specification for UUID. The identities will have 36 characters


CUSTOM

public static final IdentityStrategy CUSTOM
strategy="custom" The value "custom" specifies a strategy that uses a user own generator class.

Method Detail

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

toString

public java.lang.String toString()
Returns a string representation of the object.

Returns:
a string representation of the object.

getType

public int getType()
Accessor for the type.

Returns:
Type

getIdentityStrategy

public static IdentityStrategy getIdentityStrategy(java.lang.String value)
Gets an IdentityStrategy for the given value argument.

Parameters:
value - the String representation of IdentityStrategy
Returns:
the IdentityStrategy corresponding to the value argument. NATIVE IdentityStrategy is returned if the value argument is null or no corresponding strategy was found


Copyright © -2007 . All Rights Reserved.