Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
07/16/08 12:29:31 (6 months ago)
Author:
bwolfe
Message:

Merging trunk to the 1.3.x branch (sideporting) to get bug fixes into an RC5 release [4745]:[4946]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/1.3.x/src/api/org/openmrs/api/db/hibernate/HibernatePersonDAO.java

    r4358 r4947  
    2626import org.hibernate.criterion.MatchMode; 
    2727import org.hibernate.criterion.Order; 
     28import org.hibernate.criterion.Restrictions; 
    2829import org.hibernate.type.StringType; 
    2930import org.openmrs.Person; 
     
    376377    public List<RelationshipType> getRelationshipTypes(String relationshipTypeName, Boolean preferred) throws DAOException { 
    377378                 
    378                 Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RelationshipType.class, "t"); 
    379                 criteria.add(Expression.eq("retired", false)); 
    380                 criteria.add(Expression.sql("CONCAT(t.aIsToB, CONCAT('/', t.bIsToA))", relationshipTypeName, new StringType())); 
     379                Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RelationshipType.class); 
     380                criteria.add(Restrictions.sqlRestriction("CONCAT(a_Is_To_B, CONCAT('/', b_Is_To_A)) like (?)", relationshipTypeName, new StringType())); 
    381381         
    382382                if (preferred != null) 
     
    388388        /** 
    389389         * @see org.openmrs.api.PatientService#getRelationshipTypes() 
    390          * @see org.openmrs.api.db.PersonDAO#getAllRelationshipTypes(boolean
     390         * @see org.openmrs.api.db.PersonDAO#getAllRelationshipTypes(
    391391         */ 
    392392        @SuppressWarnings("unchecked") 
    393         public List<RelationshipType> getAllRelationshipTypes(boolean includeRetired) throws DAOException { 
     393        public List<RelationshipType> getAllRelationshipTypes() throws DAOException { 
    394394                 
    395395                Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RelationshipType.class, "t"); 
    396396                 
    397                 if (!includeRetired) 
    398                         criteria.add(Expression.eq("retired", false)); 
     397                /**if (!includeRetired) 
     398                        criteria.add(Expression.eq("retired", false));*/ 
    399399                 
    400400                criteria.addOrder(Order.asc("weight"));