When I use @Where and @ManyToMany (or @OneToMany) annotation testing.zip, it will cause SQLGrammarException because the hibernate translates the ORM into wrong query hibernate bug 2.rtf