There are two main approaches to generating object identifier:
either using a generator (either one of standard ones, or a custom
generator), or using a value of a property. The latter case is
indicated by using a placeholder generator marker
ObjectIdGenerators.; former by using explicit generator.
Object id has to be serialized as a property in case of POJOs;
object identity is currently NOT support for JSON Array types
(Java arrays or Lists) or Java Map types.
Finally, note that generator type of ObjectIdGenerators.
indicates that no Object Id should be included or used: it is included
to allow suppressing Object Ids using mix-in annotations.
| Modifier and Type | Method and Description |
|---|---|
| public Class | generator()
Generator to use for producing Object Identifier for objects:
either one of pre-defined generators from
|
| public String | property()
Name of JSON property in which Object Id will reside: also, if "from property" marker generator is used, identifies property that will be accessed to get type id. If a property is used, name must match its external name (one defined by annotation, or derived from accessor name as per Java Bean Introspection rules). |
| public Class | |
| public Class | scope()
Scope is used to define applicability of an Object Id: all ids must be unique within their scope; where scope is defined as combination of this value and generator type. |
| generator | back to summary |
|---|---|
| public Class Generator to use for producing Object Identifier for objects:
either one of pre-defined generators from
Note that special type
| |
| property | back to summary |
|---|---|
| public String property() Name of JSON property in which Object Id will reside: also, if "from property" marker generator is used, identifies property that will be accessed to get type id. If a property is used, name must match its external name (one defined by annotation, or derived from accessor name as per Java Bean Introspection rules).
Default value is | |
| resolver | back to summary |
|---|---|
| public Class Resolver to use for producing POJO from Object Identifier.
Default value is
| |
| scope | back to summary |
|---|---|
| public Class Scope is used to define applicability of an Object Id: all ids must be unique within their scope; where scope is defined as combination of this value and generator type. Comparison is simple equivalence, meaning that both type generator type and scope class must be the same. Scope is used for determining how many generators are needed; more than one scope is typically only needed if external Object Ids have overlapping value domains (i.e. are only unique within some limited scope) | |