Starting from Hibernate 4.3.0 it is unable to load collections mapped as follows:
Key part of this is SecondEntity.guid not being an @Id.
While loading this collection Hibernate issues additional query that looks like this:
For some reason this query neither contains proper entity ID nor condition from @Where annotation thus it produces HibernateException: More than one row with the given identifier was found.
I`m inculding complete example that reproduces this behaviour.
Just setup your DB connection in pom.xml and execute script.sql to create appropriate schema/data.
P.S. Issue seems to be exactly the same with @OneToMany instead of @ManyToMany.
Hibernate 4.3.0 and later. OS Win7 x64