@SuppressWarnings({"unchecked"}) private <T>List<T> executeQueryWithNamedParams(Query query,Map<String,?> params){
  Validate.notNull(query);
  Validate.notNull(params);
  for (  Map.Entry<String,?> entry : params.entrySet()) {
    query.setParameter(entry.getKey(),entry.getValue());
  }
  return query.getResultList();
}

@ SuppressWarnings ( { "unchecked" } ) private < T > List < T > executeQueryWithNamedParams ( Query query , Map < String , ? > params ) { Validate . notNull ( query ) ; Validate . notNull ( params ) ; for ( Map . Entry < String , ? > entry : params . entrySet ( ) ) { query . setParameter ( entry . getKey ( ) , entry . getValue ( ) ) ; } return query . getResultList ( ) ; }
executes a query with named parameters and returns the result list .
