use of org.hisp.dhis.sms.parse.ParserType in project dhis2-core by dhis2.
the class HibernateSMSCommandStore method getSMSCommand.
@Override
public SMSCommand getSMSCommand(String commandName, ParserType parserType) {
CriteriaBuilder builder = getCriteriaBuilder();
List<SMSCommand> list = getList(builder, newJpaParameters().addPredicate(root -> builder.equal(root.get("parserType"), parserType)).addPredicate(root -> JpaQueryUtils.stringPredicateIgnoreCase(builder, root.get("name"), commandName, JpaQueryUtils.StringSearchMode.ANYWHERE)));
if (list != null && !list.isEmpty()) {
return list.get(0);
}
return null;
}
Aggregations