Issue
Given the following native SQL query:
@Query(
value =
"SELECT "
+ "jp.BLABSTATUSID BlabStatus, "
+ "s.BLABSTATUSBEZ BlabStatusBez, "
+ "COUNT(*) sumvalue "
+ "FROM JP jp "
+ " LEFT JOIN BLAB_STATUS s "
+ " ON jp.BLABSTATUSID = s.BLABSTATUSID "
+ "GROUP BY jp.BLABSTATUSID, s.BLABSTATUSBEZ",
nativeQuery = true)
that I use in my Java / spring context, I have to switch to querydsl.
I tried:
final QJpEntity e = jpEntity;
final QBlabStatusEntity f = blabStatusEntity;
return jpaQueryFactory
.from(e)
.leftJoin(e.blabStatus, blabStatusEntity)
.on(blabStatusEntity.blabstatusid)
.groupBy(e.blabStatus.blabstatusid, f.blabstatusbez)
.select(
Projections.constructor(
JPStatisticCounter.class,
e.blabStatus,
f.blabstatusbez,
e.count()))
.fetch();
but it cannot compile because it seems syntactically wrong.
Any ideas?
Solution
solved, it was a constructor type mismatch
Answered By - DerBenniAusA Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.