469,926 Members | 2,361 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Nhibernate composite keys

I have a legacy table which is composed out three key fields. It is
representing a bank. I'm using NHibernate in my ASP.NET application to
glue everything together. I'm already searching for an answer the last
couple of weeks, but to no aval.

The table layout is:
* customer id
* bank name
* bank account no
status
(the * means this is a part of the composite key)

This is my mapping:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Com.Hotec.Manager.Hibernate.Model.Bank,
Com.Hotec.Manager" table="bank">
<composite-id>
<key-property name="BankName" column="Bank"/>
<key-many-to-one name="Customer"
class="Com.Hotec.Manager.Hibernate.Model.Customer, Com.Hotec.Manager"
column="CustomerId"/>
<key-property name="AccountNo" column="account"/>
</composite-id>

<many-to-one name="StatusObj" column="status" not-null="true"
class="Com.Hotec.Manager.Hibernate.Model.HotecStat us,
Com.Hotec.Manager" update="false" insert="false" />
<property name="Active" column="status" type="System.Int16" not-
null="true"/>
</class>
</hibernate-mapping>

The query I'm executing: "select bank from
Com.Hotec.Manager.Hibernate.Model.Bank bank left outer join
bank.Customer customer"

The error I'm getting is: {"Could not execute query" }
NHibernate.ADOException InnerException: Exception of type
System.StackOverflowException was thrown

Is there anyone that can help me with this problem? I cannot figure it
out what is wrong... Thanks!

May 16 '07 #1
0 6039

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Thomas A. Anderson | last post: by
4 posts views Thread by Ismail Rajput | last post: by
8 posts views Thread by Roman | last post: by
7 posts views Thread by Ronald S. Cook | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.