The HQL query
from Assoc a where a.type.oid = ? and a.constituents[?].oid = ?
gets translated into
reorderedp0_.oid as oid1_,
reorderedp0_.type_oid as type2_1_
and constituen1_.topic_index = ?
Where clearly the first and second parameters (the index and the type) have been permuted.
The relevant thread in the User forum is : http://forum.hibernate.org/viewtopic.php?t=979832
Attached are a java source file that demonstrates the error, and a zipped maven2 project that supplies the Hibernate, Hibernate-Annotation, H2, and Log4J dependencies.
Hibernate 3.2.5.ga; both with MySQLInnoDB and H2 dialects; both with annotations and hand written mapping files