Possible Duplicate:
Hibernate and no PK
Anyone knows how to do hibernate mapping for table or view without a primary key?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t think Hibernate allows mapping a table without a primary key…think about how Hibernate would perform updates without a column that can uniquely identify a row.
I guess a work-around would be to use a composite key with all columns, but you are much better off adding a primary key.