I have an interface property (ITimesheetActivity) on a class that I've
mapped as a component. I haven't fleshed this out much so I mocked a
stub with Rhino (and set an Id) and tried to save it, getting the
exception.
Questions
1). should I be able to persist a mocked object?
2). the column is being treated as a string with length 50, although
the type is correctly Int32. Maybe a misuse of FNH conventions but it
can't be helping.
3). is there a quick answer or link that explains when to use a
userType instead of a component? Is there a better way to use
ITimesheetActivity in my object model and persist it with just an Id?
HBM mapping:
<component name="Activity" insert="true" update="true">
<property name="Id" type="Int32">
<column name="ActivityId" not-null="true" unique="true"
length="50" />
</property>
</component>
FNH mapping:
mapping.Component(x => x.Activity, c =>
c.Map(x => x.Id, "ActivityId").Not.Nullable
().Unique());
TIA,
Berryl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---