Skip to content

Commit

Permalink
BAH-3995 | Fix. Case insensitive match while getting unit of measure …
Browse files Browse the repository at this point in the history
…by name (#85)
  • Loading branch information
mohan-13 authored Jun 26, 2024
1 parent 066b414 commit 0c9dbcc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0c9dbcc

Please sign in to comment.