@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface Id
Id Annotation. A field marked with @Id will act as
a database ID. Exactly one field can be designated
to be a database ID. If no fields are annotated with @Id,
InterSystems IRIS will still generate a unique database ID which
will be available via some XEP operations, or via SQL
operations as %ID field. In order to create a compound
primary key, use the appropriate Index annotation
instead. A class can have either a single @Id annotation,
or a single compound id key declaration, otherwise an
exception will be thrown at the time such a class is
imported.
If generated = true (default), database ID will be
generated by InterSystems IRIS (%ID field on the IRIS side) and
the field annotated as ID must be java.lang.Long type.
This field is expected to be null prior to insert/store
and will be filled automatically by XEP upon completion
of such an operation.
If generated is false, the corresponding field will
act as a user assigned ID. Fields designed as
user-defined IDs can be of the following types:
java.lang.String, int, java.lang.Integer, long and
java.lang.Long.