Hi, I am relatively new to using hibernate...Is it possible to invoke a query returning multiple rows WITH THE SAME PRIMARY KEY into a list object?....I have tried many things, but keep getting an error that multiple rows are being returned with the same identifier...but, that is what I need returned...Any help or suggestions would greatly be appreciated!
I dont think it really make sense when you say multiple rows are returned with same primary key. In relational database, a primay key is meant for uniquely identifying a row/record. In case one key is not able to identify a record uniquely, a combination of keys are used(composite key).
And ideally each table should have a primary/composite key in a relational DB.
Indeed. "non-unique primary key" is an oxymoron. Have a search through this forum for questions about data modelled without a proper primary key. This sort of question gets asked a lot and the pros and cons of doing this have been discussed many times before.
I have seen the scenario when it happens after a join query. But I never get exception. Have you checked your mapping your case looks to be of one-to-many mapping and also tru putting logical equal and hashcode method.