Changeset 4231 for openmrs/branches/api_refactoring/src/api/org/openmrs/api/db/hibernate/HibernateConceptDAO.java
- Timestamp:
- 05/15/08 20:15:52 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/api_refactoring/src/api/org/openmrs/api/db/hibernate/HibernateConceptDAO.java
r4198 r4231 347 347 */ 348 348 @SuppressWarnings("unchecked") 349 public List<ConceptWord> getConcepts(String phrase, L ocale loc, boolean includeRetired,349 public List<ConceptWord> getConcepts(String phrase, List<Locale> locales, boolean includeRetired, 350 350 List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, 351 351 List<ConceptDatatype> requireDatatypes, List<ConceptDatatype> excludeDatatypes, 352 352 Integer start, Integer size) 353 353 { 354 String locale = loc.getLanguage().substring(0, 2); //only get language portion of locale 354 355 //String locale = loc.getLanguage().substring(0, 2); //only get language portion of locale 355 356 List<String> words = ConceptWord.getUniqueWords(phrase); //assumes getUniqueWords() removes quote(') characters. (otherwise we would have a security leak) 356 357 … … 360 361 361 362 Criteria searchCriteria = sessionFactory.getCurrentSession().createCriteria(ConceptWord.class, "cw1"); 362 searchCriteria.add( Restrictions.eq("locale", locale));363 searchCriteria.add(Expression.in("locale", locales)); 363 364 if (includeRetired == false) { 364 365 searchCriteria.createAlias("concept", "concept"); … … 375 376 .add(Expression.eqProperty("concept", "cw1.concept")) 376 377 .add(Restrictions.like("word", w, MatchMode.START)) 377 .add( Restrictions.eq("locale", locale));378 .add(Expression.in("locale", locales)); 378 379 junction.add(Subqueries.exists(crit)); 379 380 }