net.java.ao
Annotation Type Generator


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Generator

Marks a specific method (and thus, database field) to contain a generated value on INSERT. The precise value and generation algorithm is specified by the ValueGenerator class. This can be used to implement functionality like UUID keys and other values which must be generated in the application layer.

This only generates values for INSERT statements, not UPDATE, SELECT or any such statement. It is likely that down the road, such functionality will be added. However, at the moment the designed use-case is something like UUID primary keys, rather than an application-layer ON UPDATE.

Author:
Daniel Spiewak
See Also:
ValueGenerator

Required Element Summary
 Class<? extends ValueGenerator<?>> value
          Specifies the generator class to use in creating new values for the field in question.
 

Element Detail

value

public abstract Class<? extends ValueGenerator<?>> value
Specifies the generator class to use in creating new values for the field in question. This generator should be thread-safe and execute very quickly.



Copyright © 2007-2014. All Rights Reserved.