I'm having trouble getting a DetachedCriteria query workking. The same one works fine in SQL Server and brings back around 400 records, but none using the DetachedCriteria. Here is the code and all the names and model fields are correct, no misspelling or case issues. The startDate and endDate are java.util.Date objects
Code:
DetachedCriteria d = DetachedCriteria.forClass(CaseInfoImpl.class);
d.add(Restrictions.eq("causeOfAction",code));
d.add(Restrictions.between("fileDate", startDate, endDate));
if (!"All".equalsIgnoreCase(court))
{
d.add(Restrictions.eq("court", court));
}
d.addOrder(Order.asc("court"));
logger.debug("getCasesByCauseOfAction criteria = " + d.toString());
List<IEntity> searchList = getHibernateTemplate().findByCriteria(d);
return searchList;
Is there any reason why this would return 0 records when the SQL query to the DB returns over 400?