public class PropertyBasedObjectIdGenerator extends ObjectIdGenerators.PropertyGenerator
ObjectIdGenerator.IdKey
Constructor and Description |
---|
PropertyBasedObjectIdGenerator(Class<?> scope) |
Modifier and Type | Method and Description |
---|---|
ObjectIdGenerator<Object> |
forScope(Class<?> scope)
Factory method to create a blueprint instance for specified
scope.
|
Object |
generateId(Object forPojo)
Method used for generating a new Object Identifier to serialize
for given POJO.
|
ObjectIdGenerator.IdKey |
key(Object key)
Method for constructing key to use for ObjectId-to-POJO maps.
|
ObjectIdGenerator<Object> |
newForSerialization(Object context)
Factory method called to create a new instance to use for
serialization: needed since generators may have state
(next id to produce).
|
isValidReferencePropertyName, maySerializeAsObject
public PropertyBasedObjectIdGenerator(Class<?> scope)
public Object generateId(Object forPojo)
ObjectIdGenerator
forPojo
- POJO for which identifier is neededpublic ObjectIdGenerator<Object> forScope(Class<?> scope)
ObjectIdGenerator
forScope
in class ObjectIdGenerator<Object>
public ObjectIdGenerator<Object> newForSerialization(Object context)
ObjectIdGenerator
Note that actual type of 'context' is
com.fasterxml.jackson.databind.SerializerProvider
,
but can not be declared here as type itself (as well as call
to this object) comes from databind package.
newForSerialization
in class ObjectIdGenerator<Object>
context
- Serialization context object used (of type
com.fasterxml.jackson.databind.SerializerProvider
;
may be needed by more complex generators to access contextual
information such as configuration.public ObjectIdGenerator.IdKey key(Object key)
ObjectIdGenerator
key
in class ObjectIdGenerator<Object>
Copyright © 2019 JBoss by Red Hat. All rights reserved.