← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6944: Simplified hibernate criteria in generic store

 

------------------------------------------------------------
revno: 6944
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-05-15 11:15:16 +0200
message:
  Simplified hibernate criteria in generic store
modified:
  dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.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-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java	2012-05-15 09:12:11 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java	2012-05-15 09:15:16 +0000
@@ -340,9 +340,6 @@
     @SuppressWarnings( "unchecked" )
     public List<T> getByLastUpdated( Date lastUpdated )
     {
-        Criteria criteria = getCriteria();
-        criteria.add( Restrictions.or( Restrictions.eq( "lastUpdated", lastUpdated ), Restrictions.gt( "lastUpdated", lastUpdated ) ) );
-
-        return criteria.list();
+        return getCriteria().add( Restrictions.ge( "lastUpdated", lastUpdated ) ).list();
     }
 }