dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00817
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 243: Changed from Query to Criteria in HibernateMappingStore
------------------------------------------------------------
revno: 243
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-04-23 21:52:19 +0200
message:
Changed from Query to Criteria in HibernateMappingStore
modified:
dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java
=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java 2009-04-23 19:51:58 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java 2009-04-23 19:52:19 +0000
@@ -95,11 +95,11 @@
{
Session session = sessionManager.getCurrentSession();
- Query query = session.createQuery( "from Map o where o.mapLayerPath = :mapLayerPath" );
-
- query.setString( "mapLayerPath", mapLayerPath );
-
- return (Map) query.uniqueResult();
+ Criteria criteria = session.createCriteria( Map.class );
+
+ criteria.add( Restrictions.eq( "mapLayerPath", mapLayerPath ) );
+
+ return (Map) criteria.uniqueResult();
}
@SuppressWarnings( "unchecked" )
--
Trunk
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.