Is there any easy way to convert Criteria to HQL?

后端 未结 4 1638
终归单人心
终归单人心 2021-01-04 05:55

I have posted a question few days ago about Querying on collections with the Criteria API and after all the answers I see that the thing that I am trying is not possible wit

4条回答
  •  臣服心动
    2021-01-04 06:48

    reposting from the hibernate forums... not sure if it is relevant to nhibernate or up to date


    from: max Hibernate Team

    Posted: Sun Dec 24, 2006 7:12 am

    it is a very stubborn folklore that criteria translates to HQL. Criteria goes directly to SQL, but there is no direct public api to get it programmatically.

    ...

    translating twice isn't very efficient ;)

    http://forum.hibernate.org/viewtopic.php?t=968990&view=next&sid=50454aa6cec8d482198117fbd398ca70

提交回复
热议问题