Using Hibernate and its query Language. I try to execute the below query in POJO
String sql = "select (select count(*) from Data v where " + insuranceId +" in (v.insuranceId1.id, v.insuranceId2.id, v.insuranceId3.id))" +" + (select count(*) from Sat s where " + insuranceId +" in (s.insuranceId1.id, s.insuranceId2.id, s.insuranceId3.id))";
Using Hibernate and its query Language. I try to execute the below query in POJO
String sql = "select (select count(*) from Data v where " + insuranceId +" in (v.insuranceId1.id, v.insuranceId2.id, v.insuranceId3.id))" +" + (select count(*) from Sat s where " + insuranceId +" in (s.insuranceId1.id, s.insuranceId2.id, s.insuranceId3.id))";
em.createQuery(sql, Long.class).getSingleResult();
I get the following error
2:27:47,128 ERROR [stderr] (http-/0.0.0.0:8080-5) java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select (select count(*) from Data v where 991 in (v.insuranceId1.id, v.insuranceId2.id, v.insuranceId3.id)) + (select count(*) from Slot s where 991 in (s.insuranceId1.id, s.insuranceId2.id, s.insuranceId3.id))]
|