=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2013-02-04 14:57:16 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2013-02-07 08:40:18 +0000 @@ -64,34 +64,34 @@ T getByCode( String code ); /** - * Retrieves a Collection of all objects (sorted on name). + * Retrieves a List of all objects (sorted on name). * - * @return a Collection of all objects. + * @return a List of all objects. */ - Collection getAllOrderedName(); + List getAllOrderedName(); /** * Retrieves the objects determined by the given first result and max result. * * @param first the first result object to return. * @param max the max number of result objects to return. - * @return collection of objects. + * @return list of objects. */ - Collection getAllOrderedName( int first, int max ); + List getAllOrderedName( int first, int max ); /** - * Retrieves a Collection of objects where the name is equal the given name. + * Retrieves a List of objects where the name is equal the given name. * * @param name the name. - * @return a Collection of objects. + * @return a List of objects. */ List getAllEqName( String name ); /** - * Retrieves a Collection of objects where the name is equal the given name (ignore case). + * Retrieves a List of objects where the name is equal the given name (ignore case). * * @param name the name. - * @return a Collection of objects. + * @return a List of objects. */ List getAllEqNameIgnoreCase( String name ); @@ -107,12 +107,12 @@ int getCountEqNameNoAcl( String name ); /** - * Retrieves a Collection of objects where the name is like the given name. + * Retrieves a List of objects where the name is like the given name. * * @param name the name. - * @return a Collection of objects. + * @return a List of objects. */ - Collection getAllLikeName( String name ); + List getAllLikeName( String name ); /** * Retrieves the objects determined by the given first result and max result. @@ -120,7 +120,7 @@ * * @param first the first result object to return. * @param max the max number of result objects to return. - * @return collection of objects. + * @return List of objects. */ List getAllOrderedLastUpdated( int first, int max ); @@ -131,9 +131,9 @@ * @param name the name which result object names must be like. * @param first the first result object to return. * @param max the max number of result objects to return. - * @return collection of objects. + * @return List of objects. */ - Collection getAllLikeNameOrderedName( String name, int first, int max ); + List getAllLikeNameOrderedName( String name, int first, int max ); /** * Gets the count of objects which name is like the given name. @@ -144,9 +144,9 @@ int getCountLikeName( String name ); /** - * Retrieves a list of objects referenced by the given collection of uids. + * Retrieves a list of objects referenced by the given List of uids. * - * @param uids a collection of uids. + * @param uids a List of uids. * @return a list of objects. */ List getByUid( Collection uids ); @@ -190,7 +190,7 @@ * @param user the user. * @return list of objects. */ - Collection getByUser( User user ); + List getByUser( User user ); /** * Retrieves objects which are accessible to the given user, which includes === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericNameableObjectStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericNameableObjectStore.java 2013-02-04 14:57:16 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericNameableObjectStore.java 2013-02-07 08:40:18 +0000 @@ -27,7 +27,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.Collection; import java.util.List; /** @@ -57,18 +56,18 @@ int getCountEqShortNameNoAcl( String shortName ); /** - * Retrieves a Collection of objects where the name is like the given name. + * Retrieves a List of objects where the name is like the given name. * * @param shortName the name. - * @return a Collection of objects. + * @return a List of objects. */ List getAllEqShortName( String shortName ); /** - * Retrieves a Collection of objects where the name is like the given name (ignore case). + * Retrieves a List of objects where the name is like the given name (ignore case). * * @param shortName the name. - * @return a Collection of objects. + * @return a List of objects. */ List getAllEqShortNameIgnoreCase( String shortName ); } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java 2013-01-16 13:50:06 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java 2013-02-07 08:40:18 +0000 @@ -28,6 +28,7 @@ */ import java.util.Collection; +import java.util.List; /** * @author Lars Helge Overland @@ -73,11 +74,11 @@ T load( int id ); /** - * Retrieves a Collection of all objects. + * Retrieves a List of all objects. * - * @return a Collection of all objects. + * @return a List of all objects. */ - Collection getAll(); + List getAll(); /** * Removes the given object instance. === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateLockExceptionStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateLockExceptionStore.java 2013-01-14 21:35:56 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateLockExceptionStore.java 2013-02-07 08:40:18 +0000 @@ -45,7 +45,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; -import java.util.Collection; +import java.util.List; /** * @author Morten Olav Hansen @@ -93,11 +93,11 @@ } @Override - public Collection getCombinations() + public List getCombinations() { final String sql = "select distinct datasetid, periodid from lockexception"; - final Collection lockExceptions = new ArrayList(); + final List lockExceptions = new ArrayList(); jdbcTemplate.query( sql, new RowCallbackHandler() { @@ -135,7 +135,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getAllOrderedName( int first, int max ) + public List getAllOrderedName( int first, int max ) { Criteria criteria = getCriteria(); criteria.setFirstResult( first ); === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java 2013-01-24 04:15:05 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java 2013-02-07 08:40:18 +0000 @@ -28,10 +28,6 @@ */ -import java.util.Collection; -import java.util.Iterator; - - import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Order; @@ -41,6 +37,10 @@ import org.hisp.dhis.user.User; import org.hisp.dhis.user.UserStore; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + /** * @author Nguyen Hong Duc @@ -54,8 +54,8 @@ // ------------------------------------------------------------------------- @Override - @SuppressWarnings( "unchecked" ) - public Collection getAllOrderedName( int first, int max ) + @SuppressWarnings("unchecked") + public List getAllOrderedName( int first, int max ) { Criteria criteria = getCriteria(); criteria.addOrder( Order.asc( "surname" ) ).addOrder( Order.asc( "firstName" ) ); @@ -65,8 +65,8 @@ } @Override - @SuppressWarnings( "unchecked" ) - public Collection getAllLikeNameOrderedName( String name, int first, int max ) + @SuppressWarnings("unchecked") + public List getAllLikeNameOrderedName( String name, int first, int max ) { Criteria criteria = getCriteria(); criteria.add( Restrictions.or( Restrictions.ilike( "surname", "%" + name + "%" ), @@ -77,9 +77,9 @@ return criteria.list(); } - public Collection getUsersWithoutOrganisationUnit() + public List getUsersWithoutOrganisationUnit() { - Collection users = getAll(); + List users = getAll(); Iterator iterator = users.iterator(); @@ -94,8 +94,8 @@ return users; } - @SuppressWarnings( "unchecked" ) - public Collection getUsersByPhoneNumber( String phoneNumber ) + @SuppressWarnings("unchecked") + public List getUsersByPhoneNumber( String phoneNumber ) { String hql = "from User u where u.phoneNumber = :phoneNumber"; @@ -105,8 +105,8 @@ return query.list(); } - @SuppressWarnings( "unchecked" ) - public Collection getUsersByOrganisationUnits( Collection orgunits ) + @SuppressWarnings("unchecked") + public List getUsersByOrganisationUnits( Collection orgunits ) { String hql = "select distinct u from User u join u.organisationUnits o where o.id in (:ids)"; @@ -121,15 +121,14 @@ } @Override - @SuppressWarnings( "unchecked" ) - public Collection getUsersByName( String name ) + @SuppressWarnings("unchecked") + public List getUsersByName( String name ) { Criteria criteria = getCriteria(); criteria.add( Restrictions.or( Restrictions.ilike( "surname", "%" + name + "%" ), Restrictions.ilike( "firstName", "%" + name + "%" ) ) ); criteria.addOrder( Order.asc( "surname" ) ).addOrder( Order.asc( "firstName" ) ); - - return criteria.list(); + + return criteria.list(); } - } === 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 2013-02-04 14:57:16 +0000 +++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2013-02-07 08:40:18 +0000 @@ -366,7 +366,7 @@ @Override @SuppressWarnings("unchecked") - public final Collection getAll() + public final List getAll() { Query query = sharingEnabled() ? getQueryAllACL() : getQueryAll(); @@ -516,8 +516,8 @@ } @Override - @SuppressWarnings( "unchecked" ) - public Collection getAllLikeName( String name ) + @SuppressWarnings("unchecked") + public List getAllLikeName( String name ) { Query query = sharingEnabled() ? getQueryAllLikeNameACL( name ) : getQueryAllLikeName( name ); @@ -549,7 +549,7 @@ @Override @SuppressWarnings("unchecked") - public final Collection getAllOrderedName() + public final List getAllOrderedName() { Query query = sharingEnabled() ? getQueryAllOrderedNameACL() : getQueryAllOrderedName(); @@ -577,7 +577,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getAllOrderedName( int first, int max ) + public List getAllOrderedName( int first, int max ) { Query query = sharingEnabled() ? getQueryAllOrderedNameACL() : getQueryAllOrderedName(); @@ -620,7 +620,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getAllLikeNameOrderedName( String name, int first, int max ) + public List getAllLikeNameOrderedName( String name, int first, int max ) { Query query = sharingEnabled() ? getQueryAllLikeNameOrderedNameACL( name ) : getQueryAllLikeNameOrderedName( name ); @@ -839,7 +839,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getByUser( User user ) + public List getByUser( User user ) { Query query = getQuery( "from " + clazz.getName() + " c where user = :user" ); query.setEntity( "user", user );