@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.
ValueGenerator
Modifier and Type | Required Element and Description |
---|---|
Class<? extends ValueGenerator<?>> |
value
Specifies the generator class to use in creating new values
for the field in question.
|
public abstract Class<? extends ValueGenerator<?>> value
Copyright © 2007–2021 Atlassian. All rights reserved.