Getting the following error when I try a query with !=
JpqlSyntaxException: Errors found for input jpql:[select u from ecosmart$MeterReadingTotal u where u.meterSerial = ?1 and u.meterChannel=?2 and u.readDate=?3 and u.source!=?5 and u.icp.icpIdentifier=?4]
line 1:120 no viable alternative at character '!'
Here is the actual query code:
return em.createQuery("select u from ecosmart$MeterReadingTotal u " +
"where u.meterSerial = ?1 and u.meterChannel=?2 and u.readDate=?3 and u.icp.icpIdentifier=?4 and u.source!=?5", MeterReadingTotal.class)
.setParameter(1, meterSerial)
.setParameter(2, meterChannel)
.setParameter(3, date)
.setParameter(4, icp)
.setParameter(5, MeterReadingSource.COMPLETED_SWITCH)
.getFirstResult();