I have a query run on DB2:
SELECT f.*
FROM Fat f
INNER EFat ef
ON f.id = ef.id AND f.seq = ef.seq
How do I reverse it in Java? I tried this way, but it gives error, all my classes are with their due relationships:
StringBuilder sb = new StringBuilder();
sb.append("SELECT f FROM ")
.append(getClasseGenerica().getSimpleName() + " f ")
.append(" INNER JOIN f.eFaturas ef ")
My question is what to do, this:
ON f.id = ef.id AND f.seq = ef.seq
With this in JAVA:
.append(" AND f.id = ef.id AND f.seq = ef.seq ")
Query query = getEntityManager().createQuery(sb.toString());
When I put AND
or WHERE
it always gives error in executing the query.