Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
08/02/08 06:38:25 (5 months ago)
Author:
jmiranda
Message:

data_synchronization_bidirectional: Fixed bug that was causing several concept service unit tests to fail. The bug involved searching for concepts by name and locale. Also, refactored unit tests to use assert statements correctly (always use asserts with a brief message about what is being asserted and put the expected/actual values in the right order to avoid confusion).

Files:

Legend:

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

    r4969 r5133  
    398398                        criteria.createAlias("names", "names"); 
    399399                        MatchMode matchmode = MatchMode.EXACT; 
    400                         if (searchOnPhrase) 
     400                        if (searchOnPhrase) {  
    401401                                matchmode = MatchMode.ANYWHERE; 
     402                        } 
    402403                         
    403404                        criteria.add(Expression.like("names.name", name, matchmode)); 
    404                         criteria.add(Expression.eq("names.locale", loc.getLanguage().substring(0, 2))); 
     405                        criteria.add(Expression.like("names.locale", loc.getLanguage().substring(0, 2), MatchMode.START)); 
    405406                } 
    406407