dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25445
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12631: Cleanup
------------------------------------------------------------
revno: 12631
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-14 13:20:58 +0200
message:
Cleanup
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientattributevalue/hibernate/HibernatePatientAttributeValueStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.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-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java 2013-09-27 17:04:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java 2013-10-14 11:20:58 +0000
@@ -28,6 +28,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.Collection;
+import java.util.Date;
+
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
@@ -40,31 +43,15 @@
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.system.util.DateUtils;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-import java.util.Collection;
-import java.util.Date;
/**
* @author Abyot Asalefew Gizaw
- * @version $Id$
*/
public class HibernatePatientIdentifierStore
extends HibernateIdentifiableObjectStore<PatientIdentifier>
implements PatientIdentifierStore
{
// -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private JdbcTemplate jdbcTemplate;
-
- public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
- {
- this.jdbcTemplate = jdbcTemplate;
- }
-
- // -------------------------------------------------------------------------
// Implementation methods
// -------------------------------------------------------------------------
@@ -166,7 +153,6 @@
.list();
}
- @SuppressWarnings("deprecation")
public boolean checkDuplicateIdentifier( PatientIdentifierType patientIdentifierType, String identifier,
Integer patientId, OrganisationUnit organisationUnit, Program program, PeriodType periodType )
{
@@ -197,6 +183,6 @@
+ DateUtils.getMediumDateString( period.getEndDate() ) + "'";
}
- return jdbcTemplate.queryForInt( sql ) == 0 ? false : true;
+ return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? false : true;
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-10-14 11:13:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-10-14 11:20:58 +0000
@@ -28,6 +28,25 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.patient.Patient.FIXED_ATTR_AGE;
+import static org.hisp.dhis.patient.Patient.FIXED_ATTR_BIRTH_DATE;
+import static org.hisp.dhis.patient.Patient.FIXED_ATTR_REGISTRATION_DATE;
+import static org.hisp.dhis.patient.Patient.PREFIX_FIXED_ATTRIBUTE;
+import static org.hisp.dhis.patient.Patient.PREFIX_IDENTIFIER_TYPE;
+import static org.hisp.dhis.patient.Patient.PREFIX_PATIENT_ATTRIBUTE;
+import static org.hisp.dhis.patient.Patient.PREFIX_PROGRAM;
+import static org.hisp.dhis.patient.Patient.PREFIX_PROGRAM_EVENT_BY_STATUS;
+import static org.hisp.dhis.patient.Patient.PREFIX_PROGRAM_INSTANCE;
+import static org.hisp.dhis.patient.Patient.PREFIX_PROGRAM_STAGE;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
@@ -50,21 +69,10 @@
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.system.grid.GridUtils;
import org.hisp.dhis.system.util.TextUtils;
-import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.transaction.annotation.Transactional;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-
-import static org.hisp.dhis.patient.Patient.*;
-
/**
* @author Abyot Asalefew Gizaw
*/
@@ -93,13 +101,6 @@
this.statementBuilder = statementBuilder;
}
- private JdbcTemplate jdbcTemplate;
-
- public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
- {
- this.jdbcTemplate = jdbcTemplate;
- }
-
// -------------------------------------------------------------------------
// Implementation methods
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientattributevalue/hibernate/HibernatePatientAttributeValueStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientattributevalue/hibernate/HibernatePatientAttributeValueStore.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientattributevalue/hibernate/HibernatePatientAttributeValueStore.java 2013-10-14 11:20:58 +0000
@@ -40,7 +40,6 @@
import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
import org.hisp.dhis.patientattributevalue.PatientAttributeValueStore;
import org.hisp.dhis.program.Program;
-import org.springframework.jdbc.core.JdbcTemplate;
/**
* @author Abyot Asalefew
@@ -50,18 +49,6 @@
extends HibernateGenericStore<PatientAttributeValue>
implements PatientAttributeValueStore
{
-
- // -------------------------------------------------------------------------
- // Dependency
- // -------------------------------------------------------------------------
-
- private JdbcTemplate jdbcTemplate;
-
- public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
- {
- this.jdbcTemplate = jdbcTemplate;
- }
-
// -------------------------------------------------------------------------
// Implementation methods
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java 2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java 2013-10-14 11:20:58 +0000
@@ -43,7 +43,6 @@
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceStore;
import org.hisp.dhis.program.SchedulingProgramObject;
-import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
/**
@@ -54,17 +53,6 @@
implements ProgramInstanceStore
{
// -------------------------------------------------------------------------
- // Dependency
- // -------------------------------------------------------------------------
-
- private JdbcTemplate jdbcTemplate;
-
- public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
- {
- this.jdbcTemplate = jdbcTemplate;
- }
-
- // -------------------------------------------------------------------------
// Implemented methods
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-10-08 17:16:47 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-10-14 11:20:58 +0000
@@ -69,7 +69,6 @@
import org.hisp.dhis.system.util.DateUtils;
import org.hisp.dhis.system.util.TextUtils;
import org.hisp.dhis.user.CurrentUserService;
-import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
/**
@@ -83,13 +82,6 @@
// Dependency
// -------------------------------------------------------------------------
- private JdbcTemplate jdbcTemplate;
-
- public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
- {
- this.jdbcTemplate = jdbcTemplate;
- }
-
private StatementBuilder statementBuilder;
public void setStatementBuilder( StatementBuilder statementBuilder )