Duplicate records

Posted by czuroski on Stack Overflow See other posts from Stack Overflow or by czuroski
Published on 2010-05-14T14:00:20Z Indexed on 2010/05/14 14:04 UTC
Read the original article Hit count: 153

Filed under:

Hello, I am using nHibernate for db persistence. I have a one-to-many relationship defined between 2 tables. When I query and try to get data, I am getting the correct number of rows from the "many" table, but the rows are duplicates of the first row returned.

table1 (one), table2 (many). I create a criteria query to get a certain record from table1. I then expect to get all associated records from table2. ie, table1 holds orders, table2 holds items. I query table1 to get an order which has 4 items. I expect to see each of those 4 items from table2, but all I am seeing is the 1st item repeated 4 times.

Does anyone have any idea what might be happening?

© Stack Overflow or respective owner

Related posts about nhibernate