I'm getting NonUniqueObjectException in hibernate.
There is one Item class, I saved list of Item objects using session.save
of hibernate.
Now in the same transaction, I'm trying to update same Items using raw sql query which has join with another table. This gives me NonUniqueObjectException. The two tables I'm joining are unrelated as entities for hibernate, that is, there is no foreign key relation.
So I have 2 questions:
- First, is there any way of using hql for writing inner join queries in hibernate.
- Second, how to avoid NonUniqueObjectException.