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.
Hibernate Version: v1.1.4322
Database: Sql server 2000, SP4
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:
Code:
<?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.HotecStatus,
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!