GirishS: the query that I run on SQL is generated from
query.getSQLStatement(), Ive already check the query.toString() as well, the query is correct.
I have to link 3 table in circle.
tableA has ItemId, RefType
tableB has ItemId, GroupId
tableC has RefType, GroupId
tableA join to tableB by ItemId, then join to tableC by C.RefType = A.RefType and C.GroupId = B.GroupId
=> the select statement is working fine as posted.
but I need to implement to query builder to add some more range input by user.
=> Query add table A, then add tableB (link A and B), then add tableC (link B and C), then I have to add link C and A, but cannot add tableA again, so I used add addDynalink() to link tableC to existed tableA.
=> the query statement generate from query.toString() and query.getSQLStatement() is as I expected, and execute fine in SQL.
if remove link of tableC to tableA, queryRun return more than 1 record and not correct.
Ive just confuse why queryRun not return data as query statement.