| Parenthesis are interpreted in WHERE conditions when using paging and SQL Server. Example:
Query<?> query = sessionFactory.getCurrentSession().createQuery("SELECT phase.description FROM DaoPhase phase WHERE phase.description = '(AMG-0006-17 ' ORDER BY phase.id");
query.setMaxResults(1000);
query.getResultList();
Execption:
Reason: This happens in the generateIgnoreRanges() method inside the SQLServer2005LimitHandler class which counts all parenthesis in the generated SQL ignoring which part is a string and which part is SQL. |