In my map I have:
Component(
x => x.ExposureKey,
m => {
m.Map(x => x.AsOfDate).Not.Nullable();
m.Map(x => x.ExposureId).Length(30).Not.Nullable();
}
).Unique();
The relevant output from the HBM is
<component name="ExposureKey" insert="true" update="true" optimistic-lock="true" class="Some.Namespace.CreditExposureKey, Some.Namespace, Version=0.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa">
<property name="AsOfDate" type="System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="AsOfDate" not-null="true"/>
</property>
<property name="ExposureId" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="ExposureId" length="30" not-null="true"/>
</property>
</component>
which is clearly missing unique="true"
from the component
definition.
Why is this happening?