dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30752
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15631: Minor fix.
------------------------------------------------------------
revno: 15631
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-06-11 23:36:16 +0800
message:
Minor fix.
modified:
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2014-06-11 14:32:45 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2014-06-11 15:36:16 +0000
@@ -477,7 +477,8 @@
criteria.createAlias( "programInstance.program", "program" );
criteria.add( Restrictions.eq( "program", program ) );
}
-
+
+ criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
Number rs = (Number) criteria.setProjection(Projections.rowCount()).uniqueResult();
return ( rs != null && rs.intValue() > 0 ) ? rs.intValue() : 0;