Source:
<code>public List<RadiologyOrder> getRadiologyOrders(RadiologyOrderSearchCriteria searchCriteria) { final Criteria crit = sessionFactory.getCurrentSession() .createCriteria(RadiologyOrder.class); if (searchCriteria.getPatient() != null) { crit.add(Restrictions.eq("patient", searchCriteria.getPatient())); } if (!searchCriteria.getIncludeVoided()) { crit.add(Restrictions.not(Restrictions.eq("voided", true))); } if (searchCriteria.getUrgency() != null) { crit.add(Restrictions.eq("urgency", searchCriteria.getUrgency())); } if (searchCriteria.getFromEffectiveStartDate() != null) { final Disjunction disjunction = Restrictions.disjunction(); disjunction.add(Restrictions.conjunction() .add(Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE)) .add(Restrictions.ge("scheduledDate", searchCriteria.getFromEffectiveStartDate()))); disjunction.add(Restrictions.conjunction() .add(Restrictions.not(Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE))) .add(Restrictions.ge("dateActivated", searchCriteria.getFromEffectiveStartDate()))); crit.add(disjunction); } if (searchCriteria.getToEffectiveStartDate() != null) { final Disjunction disjunction = Restrictions.disjunction(); disjunction.add(Restrictions.conjunction() .add(Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE)) .add(Restrictions.le("scheduledDate", searchCriteria.getToEffectiveStartDate()))); disjunction.add(Restrictions.conjunction() .add(Restrictions.not((Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE)))) .add(Restrictions.le("dateActivated", searchCriteria.getToEffectiveStartDate()))); crit.add(disjunction); } <START> if (!StringUtils.isBlank(searchCriteria.getAccessionNumber())) { <END> crit.add(Restrictions.eq("accessionNumber", searchCriteria.getAccessionNumber())); } crit.addOrder(Order.asc("accessionNumber")); return crit.list(); }</code><technical_language>@bgeVam please isNotBlank()</technical_language>

Target:
public List<RadiologyOrder> getRadiologyOrders(RadiologyOrderSearchCriteria searchCriteria) { final Criteria crit = sessionFactory.getCurrentSession() .createCriteria(RadiologyOrder.class); if (searchCriteria.getPatient() != null) { crit.add(Restrictions.eq("patient", searchCriteria.getPatient())); } if (!searchCriteria.getIncludeVoided()) { crit.add(Restrictions.not(Restrictions.eq("voided", true))); } if (searchCriteria.getUrgency() != null) { crit.add(Restrictions.eq("urgency", searchCriteria.getUrgency())); } if (searchCriteria.getFromEffectiveStartDate() != null) { final Disjunction disjunction = Restrictions.disjunction(); disjunction.add(Restrictions.conjunction() .add(Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE)) .add(Restrictions.ge("scheduledDate", searchCriteria.getFromEffectiveStartDate()))); disjunction.add(Restrictions.conjunction() .add(Restrictions.not(Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE))) .add(Restrictions.ge("dateActivated", searchCriteria.getFromEffectiveStartDate()))); crit.add(disjunction); } if (searchCriteria.getToEffectiveStartDate() != null) { final Disjunction disjunction = Restrictions.disjunction(); disjunction.add(Restrictions.conjunction() .add(Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE)) .add(Restrictions.le("scheduledDate", searchCriteria.getToEffectiveStartDate()))); disjunction.add(Restrictions.conjunction() .add(Restrictions.not((Restrictions.eq("urgency", Urgency.ON_SCHEDULED_DATE)))) .add(Restrictions.le("dateActivated", searchCriteria.getToEffectiveStartDate()))); crit.add(disjunction); } if (StringUtils.isNotBlank(searchCriteria.getAccessionNumber())) { crit.add(Restrictions.eq("accessionNumber", searchCriteria.getAccessionNumber())); } crit.addOrder(Order.asc("accessionNumber")); return crit.list(); }