-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Duplicate IList collection using a SQL Server View
PostPosted: Wed Jan 21, 2009 4:01 pm 
Newbie

Joined: Thu Nov 20, 2008 10:44 am
Posts: 4
Hibernate version: 2.0

Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="BusinessLayer.ERAs" assembly="BusinessLayer">
<class name="ERAs" table="View_ERA" mutable="false" lazy="false">
<id name="ID" column="ID" type="Int32">
<generator class="native"/>
</id>
<property name="DateOfServiceStart" column="DateOfServiceStart" type="Date"/>
<property name="DateOfServiceEnd" column="DateOfServiceEnd" type="Date"/>
<property name="ServiceProcedureCode" column="ServiceProcedureCode" type="String"/>
<property name="ServiceModifierCode" column="ServiceModifierCode" type="String"/>
<property name="LineItemChargeAmount" column="LineItemChargeAmount" type="Decimal"/>
<property name="ServiceAllowedAmount" column="ServiceAllowedAmount" type="Decimal"/>
<property name="ServiceUnitsPaid" column="ServiceUnitsPaid" type="Decimal"/>
<property name="ServiceAmountPaid" column="ServiceAmountPaid" type="Decimal"/>
<property name="GroupReasonCode" column="GroupReasonCode" type="String"/>
<property name="AdjustmentMonetaryAmount" column="AdjustmentMonetaryAmount" type="Decimal"/>
<property name="RemarkCodeQualifier" column="RemarkCodeQualifier" type="String"/>
<property name="RemarkCode" column="RemarkCode" type="String"/>
</class>
</hibernate-mapping>

Hi there,

I have one class that is mapped to a view and that view is a collection of tables. When I run the view in SQL Server, I get all the records as duplicate because I have a one to many relationship but that is fine. I need to have it this way so I can group them on a different platform. Now when I run it through Nhibernate, it gives me the correct number of records but they are all identical because of the key used. so my question is, how I can make Nhibernate retrieve the records the same way SQL Server does?

Fahd


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.