Hi,
I have a problem. Probably it is against traditional ORM approach, but
anyway, I want to have both object reference (mapped as many-to-one)
and reference key (mapped as property) be presented in my class.
If I do something like
public class Street
{
public virtual string Id { get; set; }
}
public class House
{
public virtual string Id { get; set; }
public virtual string Street_Id { get; set; }
public virtual Street Street { get; set; }
}
<class name="House" table ="HOUSE">
<id name="Id" column="ID">
<!-- generator class="guid" / -->
</id>
<property name="Street_Id" column ="STREET_ID" />
<many-to-one name="Street"
column="STREET_ID"
class="Street"
cascade="none"
fetch="join"
/>
</class>
I get an IndexOutOfRangeException "Invalid index 2 for this
OracleParameterCollection with Count=2." when new House object is
saved.
As I understand, it is result of double mapping of STREET_ID column.
I want to see some workaround for this problem. My goal is to be able
to access Street object directly from House in one scenario and in
different scenario avoiding unnecessary loading of Street object get
it's PK using referencing House object.
--
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.