An IIdentifierGenerator that uses the value of the id property of an associated object

Namespace: NHibernate.Id
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public class ForeignGenerator : IIdentifierGenerator, 
	IConfigurable
Visual Basic
Public Class ForeignGenerator _
	Implements IIdentifierGenerator, IConfigurable
Visual C++
public ref class ForeignGenerator : IIdentifierGenerator, 
	IConfigurable

Remarks

This id generation strategy is specified in the mapping file as

CopyC#
<generator class="foreign">
    <param name="property">AssociatedObject</param>
</generator>

The mapping parameter property is required.

Inheritance Hierarchy

System..::..Object
  NHibernate.Id..::..ForeignGenerator

See Also