diff --git a/openelis/src/us/mn/state/health/lims/unitofmeasure/daoimpl/UnitOfMeasureDAOImpl.java b/openelis/src/us/mn/state/health/lims/unitofmeasure/daoimpl/UnitOfMeasureDAOImpl.java index 31bcb83a3..22856cef5 100644 --- a/openelis/src/us/mn/state/health/lims/unitofmeasure/daoimpl/UnitOfMeasureDAOImpl.java +++ b/openelis/src/us/mn/state/health/lims/unitofmeasure/daoimpl/UnitOfMeasureDAOImpl.java @@ -242,9 +242,9 @@ public List getPreviousUnitOfMeasureRecord(String id) public UnitOfMeasure getUnitOfMeasureByName(UnitOfMeasure unitOfMeasure) throws LIMSRuntimeException { try { - String sql = "from UnitOfMeasure u where u.unitOfMeasureName = :param"; + String sql = "from UnitOfMeasure u where trim(lower(u.unitOfMeasureName)) = :param"; org.hibernate.Query query = HibernateUtil.getSession().createQuery(sql); - query.setParameter("param", unitOfMeasure.getUnitOfMeasureName()); + query.setParameter("param", unitOfMeasure.getUnitOfMeasureName().trim().toLowerCase()); List list = query.list(); HibernateUtil.getSession().flush();