Exception: org.hibernate.hql.ast.QuerySyntaxException: expecting CLOSE, found 'UNION' near line 1, column 442
This is the Query which am writing in DAO file
StringBuffer subQuery = new StringBuffer(); subQuery.append(" Expense.lineNumber in ("); subQuery.append(" (SELECT ExpensePaymentAlloc.charge.lineNumber " ); subQuery.append(" FROM ExpensePaymentAllocVO as ExpensePaymentAlloc "); subQuery.append(" WHERE ExpensePaymentAlloc.payment.payable.payableId = "); subQuery.append( fieldValue ); subQuery.append(" ) union all ( Expense.lineNumber in ( SELECT PaymentReserve.expenseLineNumber " ); subQuery.append(" FROM PaymentReserveVO as PaymentReserve "); subQuery.append(" WHERE PaymentReserve.payment.payable.payableId = "); subQuery.append( fieldValue ); subQuery.append(" ))) ");
When i use this query am facting this problem, can you please provide me the steps to resole this or provide me the alternate query to this.
Thanks in advance
|