| 
					
						 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 
					
  
						
					 |