0
I have a query executed 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’s wrong, all my classes are with their proper relationships:
StringBuilder sb = new StringBuilder();
sb.append("SELECT f FROM ")
.append(getClasseGenerica().getSimpleName() + " f ")
.append(" INNER JOIN f.eFaturas ef ")   
My question is to do, that:
ON f.id = ef.id AND f.seq = ef.seq
With that 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 always gives error in query execution.
In the question there is a
ANDin place ofON– Pagotti
I didn’t understand what you said.
– Marquin Ferreira