dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40575
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20597: use distinct in tei hql query, needed since we now use collection pre-fetching, which can cause d...
------------------------------------------------------------
revno: 20597
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-10-09 10:21:10 +0700
message:
use distinct in tei hql query, needed since we now use collection pre-fetching, which can cause duplicates
modified:
dhis-2/dhis-services/dhis-service-core/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-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2015-10-07 13:22:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2015-10-09 03:21:10 +0000
@@ -121,7 +121,7 @@
private String buildTrackedEntityInstanceHql( TrackedEntityInstanceQueryParams params )
{
- String hql = "from TrackedEntityInstance tei inner join fetch tei.attributeValues";
+ String hql = "select distinct tei from TrackedEntityInstance tei inner join fetch tei.attributeValues";
SqlHelper hlp = new SqlHelper( true );
if ( params.hasTrackedEntity() )