Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/15/08 20:15:52 (6 months ago)
Author:
bwolfe
Message:

Merging trunk to api-refactoring [4191]:[4230]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/api_refactoring/src/api/org/openmrs/api/db/hibernate/HibernateConceptDAO.java

    r4198 r4231  
    347347         */ 
    348348        @SuppressWarnings("unchecked") 
    349         public List<ConceptWord> getConcepts(String phrase, Locale loc, boolean includeRetired,  
     349        public List<ConceptWord> getConcepts(String phrase, List<Locale> locales, boolean includeRetired,  
    350350                        List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, 
    351351                        List<ConceptDatatype> requireDatatypes, List<ConceptDatatype> excludeDatatypes, 
    352352                        Integer start, Integer size)  
    353353                        { 
    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 
    355356                List<String> words = ConceptWord.getUniqueWords(phrase); //assumes getUniqueWords() removes quote(') characters.  (otherwise we would have a security leak) 
    356357                 
     
    360361                 
    361362                        Criteria searchCriteria = sessionFactory.getCurrentSession().createCriteria(ConceptWord.class, "cw1"); 
    362                         searchCriteria.add(Restrictions.eq("locale", locale)); 
     363                        searchCriteria.add(Expression.in("locale", locales)); 
    363364                        if (includeRetired == false) { 
    364365                                searchCriteria.createAlias("concept", "concept"); 
     
    375376                                                        .add(Expression.eqProperty("concept", "cw1.concept")) 
    376377                                                        .add(Restrictions.like("word", w, MatchMode.START)) 
    377                                                         .add(Restrictions.eq("locale", locale)); 
     378                                                        .add(Expression.in("locale", locales)); 
    378379                                junction.add(Subqueries.exists(crit)); 
    379380                        }