<p>Say I'm mapping a simple object to a table that contains duplicate records and I want to allow duplicates in my code.  I don't need to update/insert/delete on this table, only display the records.</p>

<p>Is there a way that I can put a fake (generated) ID column in my mapping file to trick NHibernate into thinking the rows are unique?  Creating a composite key won't work because there could be duplicates across all of the columns.</p>

<p>If this isn't possible, what is the best way to get around this issue?</p>

<p>Thanks!</p>

<p>Edit:  Query seemed to be the way to go</p>

The NHibernate mapping makes the assumption that you're going to want to save changes, hence the requirement for an ID of some kind.
If you're allowed to modify the table, you could add an identity column (SQL Server naming - your database may differ) to autogenerate unique Ids - existing code should be unaffected.
If you're allowed to add to the database, but not to the table, you could try defining a view that includes a RowNumber synthetic (calculated) column, and using that as the data source to load from. Depending on your database vendor (and the products handling of views and indexes) this
may
face some performance issues.
The other alternative, which I've not tried, would be to map your class to a SQL query instead of a table. IIRC, NHibernate supports having named SQL queries in the mapping file, and you can use those as the "data source" instead of a table or view.