Domanda

In this project the persistence layer makes use of Hibernate but the model-database mapping is configured with mostly JPA annotations.
Hibernate upgrade has become difficult because the new Hibernate version generates unnecessary joins in SQL while HQL is unchanged. So we are looking for other options instead of the HQL parser of Hibernate.
Is it possible with QueryDSL to build HQL style queries and have QueryDSL generate the SQL?

È stato utile?

Soluzione

Querydsl JPA is not a JPA implementation, so if you use Querydsl with JPA, there is no direct control of the generated SQL. If you want to use Querydsl with better control of the used SQL then use Querydsl SQL instead.

Often unnecessary joins in Hibernate are caused by implicit joins (property traversal) on the HQL level. That might also apply to your case.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top