public class ForeignGenerator extends Object implements IdentifierGenerator, Configurable
<b>foreign</b><br> <br> An <tt>Identifier</tt> generator that uses the value of the id property of an associated object<br> <br> One mapping parameter is required: property.
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
Constructor and Description |
---|
ForeignGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Type type,
Properties params,
ServiceRegistry serviceRegistry)
Configure this instance, given the value of parameters
specified by the user as <tt><param></tt> elements.
|
Serializable |
generate(SharedSessionContractImplementor sessionImplementor,
Object object)
Generate a new identifier.
|
String |
getEntityName()
Getter for property 'entityName'.
|
String |
getPropertyName()
Getter for property 'propertyName'.
|
String |
getRole()
Getter for property 'role'.
|
public String getEntityName()
Getter for property 'entityName'.
public String getPropertyName()
Getter for property 'propertyName'.
public String getRole()
Getter for property 'role'. Role is the property name
qualified by the
entity name
.
public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
Configurable
Configure this instance, given the value of parameters specified by the user as <tt><param></tt> elements. This method is called just once, following instantiation.
configure
in interface Configurable
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.MappingException
public Serializable generate(SharedSessionContractImplementor sessionImplementor, Object object)
IdentifierGenerator
Generate a new identifier.
generate
in interface IdentifierGenerator
sessionImplementor
- The session from which the request originatesobject
- the entity or collection (idbag) for which the id is being generatedCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.