Top Description Fields Constructors Methods
org.hibernate.id

public Class ForeignGenerator

extends Object
implements IdentifierGenerator, Configurable
Class Inheritance
All Implemented Interfaces
org.hibernate.id.Configurable, org.hibernate.id.IdentifierGenerator
Imports
java.io.Serializable, java.util.Properties, org.hibernate.MappingException, .Session, .TransientObjectException, org.hibernate.dialect.Dialect, org.hibernate.engine.ForeignKeys, .SessionImplementor, org.hibernate.persister.entity.EntityPersister, org.hibernate.type.EntityType, .Type

foreign

An Identifier generator that uses the value of the id property of an associated object

One mapping parameter is required: property.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private String
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
configure(Type type, Properties
param values, keyed by parameter name
params
,
Dialect d)

Implements org.hibernate.id.Configurable.configure.

Configure this instance, given the value of parameters specified by the user as <param> elements.
public Serializable
generate(SessionImplementor sessionImplementor, Object
the entity or toplevel collection for which the id is being generated
object
)

Implements org.hibernate.id.IdentifierGenerator.generate.

Generate a new identifier.
public String

Returns:

Value for property 'entityName'.
getEntityName
()

Getter for property 'entityName'.

public String

Returns:

Value for property 'propertyName'.
getPropertyName
()

Getter for property 'propertyName'.

public String

Returns:

Value for property 'role'.
getRole
()

Getter for property 'role'.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

entityNameback to summary
private String entityName
propertyNameback to summary
private String propertyName

Constructor Detail

ForeignGeneratorback to summary
public ForeignGenerator()

Method Detail

configureback to summary
public void configure(Type type, Properties params, Dialect d)

Implements org.hibernate.id.Configurable.configure.

Doc from org.hibernate.id.Configurable.configure.

Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.

Parameters
params:Properties

param values, keyed by parameter name

generateback to summary
public Serializable generate(SessionImplementor sessionImplementor, Object object)

Implements org.hibernate.id.IdentifierGenerator.generate.

Doc from org.hibernate.id.IdentifierGenerator.generate.

Generate a new identifier.

Parameters
object:Object

the entity or toplevel collection for which the id is being generated

Returns:Serializable

a new identifier

getEntityNameback to summary
public String getEntityName()

Getter for property 'entityName'.

Returns:String

Value for property 'entityName'.

getPropertyNameback to summary
public String getPropertyName()

Getter for property 'propertyName'.

Returns:String

Value for property 'propertyName'.

getRoleback to summary
public String getRole()

Getter for property 'role'. Role is the property name qualified by the entity name.

Returns:String

Value for property 'role'.