biz.c24.io.api.data
Class IDGeneratorMethodEnum

java.lang.Object
  extended by biz.c24.io.api.data.IDGeneratorMethodEnum
All Implemented Interfaces:
Serializable

public final class IDGeneratorMethodEnum
extends Object
implements Serializable

An enumeration of possible Hibernate ID Generator Method values.

These methods specifies the method of id generation for new entries being written to the database

See Also:
Serialized Form

Field Summary
static IDGeneratorMethodEnum ASSIGNED
          lets the application to assign an identifier to the object before save() is called.
static IDGeneratorMethodEnum CUSTOM
          uses a custom Java class to determine the new keys.
static IDGeneratorMethodEnum FOREIGN
          uses the identifier of another associated object.
static IDGeneratorMethodEnum GUID
          uses a database-generated GUID string on MS SQL Server and MySQL.
static IDGeneratorMethodEnum HILO
          uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values.
static IDGeneratorMethodEnum IDENTITY
          supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL.
static IDGeneratorMethodEnum INCREMENT
          generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table.
static IDGeneratorMethodEnum NATIVE
          picks identity, sequence or hilo depending upon the capabilities of the underlying database.
static IDGeneratorMethodEnum SELECT
          retrieves a primary key assigned by a database trigger by selecting the row by some unique key and retrieving the primary key value.
static IDGeneratorMethodEnum SEQHILO
          uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a named database sequence.
static IDGeneratorMethodEnum SEQUENCE
          uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase.
static IDGeneratorMethodEnum UUID
          uses a 128-bit UUID algorithm to generate identifiers of type string, unique within a network (the IP address is used).
 
Constructor Summary
IDGeneratorMethodEnum(String name)
          The constructor.
 
Method Summary
 String getName()
          Returns the name of this generator.
 String toString()
          Returns the name of this generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ASSIGNED

public static final IDGeneratorMethodEnum ASSIGNED
lets the application to assign an identifier to the object before save() is called. This is the default strategy if no element is specified.


INCREMENT

public static final IDGeneratorMethodEnum INCREMENT
generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table. Do not use in a cluster.


IDENTITY

public static final IDGeneratorMethodEnum IDENTITY
supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short or int.


SEQUENCE

public static final IDGeneratorMethodEnum SEQUENCE
uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type long, short or int


HILO

public static final IDGeneratorMethodEnum HILO
uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database.


SEQHILO

public static final IDGeneratorMethodEnum SEQHILO
uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a named database sequence.


UUID

public static final IDGeneratorMethodEnum UUID
uses a 128-bit UUID algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.


GUID

public static final IDGeneratorMethodEnum GUID
uses a database-generated GUID string on MS SQL Server and MySQL.


NATIVE

public static final IDGeneratorMethodEnum NATIVE
picks identity, sequence or hilo depending upon the capabilities of the underlying database.


SELECT

public static final IDGeneratorMethodEnum SELECT
retrieves a primary key assigned by a database trigger by selecting the row by some unique key and retrieving the primary key value.


FOREIGN

public static final IDGeneratorMethodEnum FOREIGN
uses the identifier of another associated object. Usually used in conjunction with a primary key association.


CUSTOM

public static final IDGeneratorMethodEnum CUSTOM
uses a custom Java class to determine the new keys.

Constructor Detail

IDGeneratorMethodEnum

public IDGeneratorMethodEnum(String name)
The constructor.

Parameters:
name - The name of the generator
Method Detail

getName

public String getName()
Returns the name of this generator.

Returns:
the Name

toString

public String toString()
Returns the name of this generator.

Overrides:
toString in class Object
Returns:
the Name


C24 Technologies © 2002-2012: All Rights Reserved.