EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.annotations
Annotation Type UuidGenerator


@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface UuidGenerator

Defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation. A UUID generator may be specified on the entity class or on the primary key field or property. The scope of the generator name is global to the persistence unit (across all generator types).

    Example 1:
    
    @Entity public class Employee {
        ...
        @UuidGenerator(name="uuid")
        @Id
        @GeneratedValue(generator="uuid")
        int id;
        ...
    }
 

See Also:
GeneratedValue
Author:
James Sutherland
Since:
EclipseLink 2.4

Required Element Summary
 java.lang.String name
          The name of the UUID generator, names must be unique for the persistence unit.
 

Element Detail

name

public abstract java.lang.String name
The name of the UUID generator, names must be unique for the persistence unit.


EclipseLink 2.4.2, build 'v20130514-5956486' API Reference