← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18716: Model. Made ProgramStageDataElement an IdentifiableObject.

 

------------------------------------------------------------
revno: 18716
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-03-27 16:45:41 +0100
message:
  Model. Made ProgramStageDataElement an IdentifiableObject.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/QueryUtils.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMergeService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageDataElementStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.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-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java	2015-03-24 10:52:18 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java	2015-03-27 15:45:41 +0000
@@ -28,25 +28,24 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.DxfNamespaces;
+import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.dataelement.DataElement;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonView;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.common.BaseIdentifiableObject;
-import org.hisp.dhis.common.DxfNamespaces;
-import org.hisp.dhis.common.view.DetailedView;
-import org.hisp.dhis.common.view.ExportView;
-import org.hisp.dhis.dataelement.DataElement;
-
-import java.io.Serializable;
 
 /**
  * @author Viet Nguyen
  */
 @JacksonXmlRootElement( localName = "programStageDataElement", namespace = DxfNamespaces.DXF_2_0 )
 public class ProgramStageDataElement
-    implements Serializable
+    extends BaseIdentifiableObject
 {
     /**
      * Determines if a de-serialized file is compatible with this class.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementStore.java	2015-03-27 15:45:41 +0000
@@ -28,40 +28,20 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.hisp.dhis.dataelement.DataElement;
 
 import java.util.Collection;
 
 /**
  * @author Viet Nguyen
- * @version $Id$
  */
 public interface ProgramStageDataElementStore
+    extends GenericIdentifiableObjectStore<ProgramStageDataElement>
 {
     String ID = ProgramStageInstanceStore.class.getName();
 
     /**
-     * Adds an {@link ProgramStageDataElement}
-     *
-     * @param programStageDataElement The to ProgramStageDataElement add.
-     */
-    void save( ProgramStageDataElement programStageDataElement );
-
-    /**
-     * Updates an {@link ProgramStageDataElement}.
-     *
-     * @param programStageDataElement the ProgramStageDataElement to update.
-     */
-    void update( ProgramStageDataElement programStageDataElement );
-
-    /**
-     * Deletes a {@link ProgramStageDataElement}.
-     *
-     * @param programStageDataElement the ProgramStageDataElement to delete.
-     */
-    void delete( ProgramStageDataElement programStageDataElement );
-
-    /**
      * Retrieve ProgramStageDataElement list on a program stage and a data
      * element
      *
@@ -72,14 +52,6 @@
     ProgramStageDataElement get( ProgramStage programStage, DataElement dataElement );
 
     /**
-     * Returns all {@link ProgramStageDataElement}
-     *
-     * @return a collection of all ProgramStageDataElement, or an empty
-     * collection if there are no ProgramStageDataElements.
-     */
-    Collection<ProgramStageDataElement> getAll();
-
-    /**
      * Retrieve Data element list on a program stage
      *
      * @param programStage ProgramStage

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/QueryUtils.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/QueryUtils.java	2015-03-11 19:23:05 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/QueryUtils.java	2015-03-27 15:45:41 +0000
@@ -95,7 +95,7 @@
         }
         else if ( Enum.class.isAssignableFrom( klass ) )
         {
-            Optional<? extends Enum> enumValue = Enums.getIfPresent( (Class<? extends Enum>) klass, value );
+            Optional<? extends Enum<?>> enumValue = Enums.getIfPresent( (Class<? extends Enum>) klass, value );
 
             if ( enumValue.isPresent() )
             {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMergeService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMergeService.java	2015-03-26 11:50:23 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMergeService.java	2015-03-27 15:45:41 +0000
@@ -28,6 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+
 import org.hisp.dhis.common.MergeStrategy;
 import org.hisp.dhis.schema.Property;
 import org.hisp.dhis.schema.Schema;
@@ -35,8 +37,6 @@
 import org.hisp.dhis.system.util.ReflectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.Collection;
-
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -60,7 +60,7 @@
         {
             if ( property.isCollection() )
             {
-                Collection sourceObject = ReflectionUtils.invokeMethod( source, property.getGetterMethod() );
+                Collection<?> sourceObject = ReflectionUtils.invokeMethod( source, property.getGetterMethod() );
 
                 if ( sourceObject == null )
                 {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageService.java	2015-03-27 15:45:41 +0000
@@ -35,7 +35,6 @@
 
 /**
  * @author Abyot Asalefew
- * @version $Id$
  */
 @Transactional
 public class DefaultProgramStageService

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageDataElementStore.java	2015-02-13 08:50:17 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageDataElementStore.java	2015-03-27 15:45:41 +0000
@@ -28,82 +28,30 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+
 import org.hibernate.Criteria;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageDataElementStore;
 
-import java.util.Collection;
-
 /**
  * @author Viet Nguyen
  */
 public class HibernateProgramStageDataElementStore
+    extends HibernateIdentifiableObjectStore<ProgramStageDataElement>
     implements ProgramStageDataElementStore
 {
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private SessionFactory sessionFactory;
-
-    public void setSessionFactory( SessionFactory sessionFactory )
-    {
-        this.sessionFactory = sessionFactory;
-    }
-
-    // -------------------------------------------------------------------------
-    // Implemented methods
-    // -------------------------------------------------------------------------
-
-    @Override
-    public void save( ProgramStageDataElement programStageDataElement )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.save( programStageDataElement );
-    }
-
-    @Override
-    public void update( ProgramStageDataElement programStageDataElement )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.update( programStageDataElement );
-    }
-
-    @Override
-    public void delete( ProgramStageDataElement programStageDataElement )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.delete( programStageDataElement );
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
-    public Collection<ProgramStageDataElement> getAll()
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( ProgramStageDataElement.class );
-
-        return criteria.list();
-    }
-
     @Override
     public ProgramStageDataElement get( ProgramStage programStage, DataElement dataElement )
     {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( ProgramStageDataElement.class );
-        criteria.add( Restrictions.eq( "programStage", programStage ) );
-        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+        Criteria criteria = getCriteria( 
+            Restrictions.eq( "programStage", programStage ),
+            Restrictions.eq( "dataElement", dataElement ) );
 
         return (ProgramStageDataElement) criteria.uniqueResult();
     }
@@ -112,10 +60,10 @@
     @SuppressWarnings( "unchecked" )
     public Collection<DataElement> getListDataElement( ProgramStage programStage )
     {
-        Session session = sessionFactory.getCurrentSession();
-        Criteria criteria = session.createCriteria( ProgramStageDataElement.class );
+        Criteria criteria = getCriteria();
         criteria.add( Restrictions.eq( "programStage", programStage ) );
         criteria.setProjection( Projections.property( "dataElement" ) );
+        
         return criteria.list();
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2015-03-05 16:29:11 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2015-03-27 15:45:41 +0000
@@ -28,9 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.program.ProgramExpression.OBJECT_PROGRAM_STAGE;
 import static org.hisp.dhis.program.ProgramExpression.OBJECT_PROGRAM_STAGE_DATAELEMENT;
-import static org.hisp.dhis.program.ProgramExpression.OBJECT_PROGRAM_STAGE;
-
 import static org.hisp.dhis.program.ProgramExpression.SEPARATOR_ID;
 import static org.hisp.dhis.program.ProgramExpression.SEPARATOR_OBJECT;
 
@@ -58,8 +57,6 @@
 
 /**
  * @author Chau Thu Tran
- * 
- * @version TableAlteror.java Sep 9, 2010 10:22:29 PM
  */
 public class TableAlteror
     extends AbstractStartupRoutine
@@ -318,12 +315,35 @@
         executeSql( "update userroleauthorities set authority='F_ADD_TRACKED_ENTITY_FORM' where authority='F_TRACKED_ENTITY_FORM_ADD'" );
 
         updateProgramExpressionUid();
+        
+        upgradeProgramStageDataElements();
     }
 
     // -------------------------------------------------------------------------
     // Supporting methods
     // -------------------------------------------------------------------------
 
+    private void upgradeProgramStageDataElements()
+    {        
+        String autoIncr = statementBuilder.getAutoIncrementValue();
+        
+        String insertSql = 
+            "insert into programstagedataelement(programstagedataelementid,programstageid,dataelementid,compulsory,allowprovidedelsewhere,sort_order,displayinreports,allowfuturedate) " +
+            "select " + autoIncr + ",programstageid,dataelementid,compulsory,allowprovidedelsewhere,sort_order,displayinreports,allowfuturedate " +
+            "from programstage_dataelements";
+        
+        int r = executeSql( insertSql );
+        
+        if ( r != -1 )
+        {
+            String dropSql = "drop table programstage_dataelements";
+            
+            executeSql( dropSql );
+            
+            log.info( "Upgraded program stage data elements" );
+        }            
+    }
+    
     private void updateAggregateQueryBuilder()
     {
         StatementHolder holder = statementManager.getHolder();
@@ -530,73 +550,70 @@
             holder.close();
         }
     }
-    
+
     private void updateProgramExpressionUid()
     {
-		String regExp = "\\[(" + OBJECT_PROGRAM_STAGE_DATAELEMENT + "|"
-				+ OBJECT_PROGRAM_STAGE + ")" + SEPARATOR_OBJECT + "([0-9]+["
-				+ SEPARATOR_ID + "[a-zA-z0-9]+]*)\\]";
-		
-		StatementHolder holder = statementManager.getHolder();
-
-         try
-         {
-             Statement statement = holder.getStatement();
-
-             ResultSet resultSet = statement
-                 .executeQuery( "select programexpressionid, expression from programexpression" );
-
-             while ( resultSet.next() )
-             {
-            	 int id = resultSet.getInt( "programexpressionid" );
-                 String expression = resultSet.getString( "expression" );
-                 String result = expression;
-                 
-                 Pattern pattern = Pattern.compile( regExp );
-                 Matcher matcher = pattern.matcher( expression );
-                 while ( matcher.find() )
-                 {
-                	 String group = matcher.group();
-                 	 String key = matcher.group(1);
-                	 if( key.equals( OBJECT_PROGRAM_STAGE_DATAELEMENT) )
-                	 {
-	                	 String[] ids = matcher.group(2).split( SEPARATOR_ID );
-
-	                     int programStageId = Integer.parseInt( ids[0] );
-	                	 int deId = Integer.parseInt( ids[1] );
-	                     
-	                	 String programStageUid = programStageService.getProgramStage(programStageId).getUid();
-	                	 String deUid = dataElementService.getDataElement(deId).getUid();
-
-	                	 result = result.replace(group, "[" + ProgramExpression.OBJECT_PROGRAM_STAGE_DATAELEMENT + ProgramExpression.SEPARATOR_OBJECT
-	                             + programStageUid + "." + deUid + "]" );
-                	 }
-                	 else
-                	 {
-                		String[] ids = matcher.group(2).split( SEPARATOR_ID );
- 	                    int programStageId = Integer.parseInt( ids[0] );
- 	                    String programStageUid = programStageService.getProgramStage(programStageId).getUid();
-	                	
- 	                   result = result.replace( group ,
-	                             "[" + OBJECT_PROGRAM_STAGE + ProgramExpression.SEPARATOR_OBJECT
-	                             + programStageUid +  "." + ids[1] + "]" );
-                	 }
-                 }
-                 
-                 executeSql( "UPDATE programexpression SET expression='" + result + "' WHERE programexpressionid=" + id );
-             }
-         }
-         catch ( Exception ex )
-         {
-             log.debug( ex );
-         }
-         finally
-         {
-             holder.close();
-         }
+        String regExp = "\\[(" + OBJECT_PROGRAM_STAGE_DATAELEMENT + "|" + OBJECT_PROGRAM_STAGE + ")" + SEPARATOR_OBJECT
+            + "([0-9]+[" + SEPARATOR_ID + "[a-zA-z0-9]+]*)\\]";
+
+        StatementHolder holder = statementManager.getHolder();
+
+        try
+        {
+            Statement statement = holder.getStatement();
+
+            ResultSet resultSet = statement
+                .executeQuery( "select programexpressionid, expression from programexpression" );
+
+            while ( resultSet.next() )
+            {
+                int id = resultSet.getInt( "programexpressionid" );
+                String expression = resultSet.getString( "expression" );
+                String result = expression;
+
+                Pattern pattern = Pattern.compile( regExp );
+                Matcher matcher = pattern.matcher( expression );
+                while ( matcher.find() )
+                {
+                    String group = matcher.group();
+                    String key = matcher.group( 1 );
+                    if ( key.equals( OBJECT_PROGRAM_STAGE_DATAELEMENT ) )
+                    {
+                        String[] ids = matcher.group( 2 ).split( SEPARATOR_ID );
+
+                        int programStageId = Integer.parseInt( ids[0] );
+                        int deId = Integer.parseInt( ids[1] );
+
+                        String programStageUid = programStageService.getProgramStage( programStageId ).getUid();
+                        String deUid = dataElementService.getDataElement( deId ).getUid();
+
+                        result = result.replace( group, "[" + ProgramExpression.OBJECT_PROGRAM_STAGE_DATAELEMENT
+                            + ProgramExpression.SEPARATOR_OBJECT + programStageUid + "." + deUid + "]" );
+                    }
+                    else
+                    {
+                        String[] ids = matcher.group( 2 ).split( SEPARATOR_ID );
+                        int programStageId = Integer.parseInt( ids[0] );
+                        String programStageUid = programStageService.getProgramStage( programStageId ).getUid();
+
+                        result = result.replace( group, "[" + OBJECT_PROGRAM_STAGE + ProgramExpression.SEPARATOR_OBJECT
+                            + programStageUid + "." + ids[1] + "]" );
+                    }
+                }
+
+                executeSql( "UPDATE programexpression SET expression='" + result + "' WHERE programexpressionid=" + id );
+            }
+        }
+        catch ( Exception ex )
+        {
+            log.debug( ex );
+        }
+        finally
+        {
+            holder.close();
+        }
     }
     
-    
     private int executeSql( String sql )
     {
         try

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml	2015-03-24 18:54:44 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml	2015-03-27 15:45:41 +0000
@@ -103,13 +103,13 @@
 
 	<bean id="org.hisp.dhis.trackedentity.TrackedEntityAttributeGroupStore"
 		class="org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore">
-		<property name="clazz"
-			value="org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup" />
+		<property name="clazz" value="org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup" />
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
 
 	<bean id="org.hisp.dhis.program.ProgramStageDataElementStore"
 		class="org.hisp.dhis.program.hibernate.HibernateProgramStageDataElementStore">
+		<property name="clazz" value="org.hisp.dhis.program.ProgramStageDataElement" />
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
 
@@ -414,6 +414,7 @@
 				<value>trackedentityinstancereminder</value>
 				<value>program</value>
 				<value>programstage</value>
+				<value>programstagedataelement</value>
 				<value>programinstance</value>
 				<value>programstageinstance</value>
 				<value>relationshiptype</value>

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml	2014-06-21 09:56:19 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml	2015-03-27 15:45:41 +0000
@@ -1,17 +1,23 @@
 <?xml version="1.0"?>
 <!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";>
+  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
+  [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+  >
 
 <hibernate-mapping>
-  <class name="org.hisp.dhis.program.ProgramStageDataElement" table="programstage_dataelements">
-
-    <composite-id>
-      <key-many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage" column="programstageid"
-        foreign-key="fk_programstagedataelement_programstageid" />
-      <key-many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid"
-        foreign-key="fk_programstagedataelement_dataelementid" />
-    </composite-id>
+  <class name="org.hisp.dhis.program.ProgramStageDataElement" table="programstagedataelement">
+
+	<id name="id" column="programstagedataelementid">
+      <generator class="native" />
+    </id>
+    &identifiableProperties;
+
+    <many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage" column="programstageid"
+      foreign-key="fk_programstagedataelement_programstageid" unique-key="programstagedataelement_unique_key" />
+      
+    <many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid"
+      foreign-key="fk_programstagedataelement_dataelementid" unique-key="programstagedataelement_unique_key" />
 
     <property name="compulsory" column="compulsory" not-null="true" />
 
@@ -19,9 +25,9 @@
 
     <property name="sortOrder" column="sort_order" />
 
-    <property name="displayInReports" />
+    <property name="displayInReports" column="displayinreports" />
 
-    <property name="allowFutureDate" />
+    <property name="allowFutureDate" column="allowfuturedate"/>
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java	2015-03-27 04:16:43 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java	2015-03-27 15:45:41 +0000
@@ -30,14 +30,13 @@
 
 import static org.hisp.dhis.program.ProgramIndicator.KEY_ATTRIBUTE;
 import static org.hisp.dhis.program.ProgramIndicator.KEY_DATAELEMENT;
-import static org.hisp.dhis.program.ProgramIndicator.VALUE_TYPE_INT;
 import static org.hisp.dhis.program.ProgramIndicator.KEY_PROGRAM_VARIABLE;
 import static org.hisp.dhis.program.ProgramIndicator.VALUE_TYPE_DATE;
+import static org.hisp.dhis.program.ProgramIndicator.VALUE_TYPE_INT;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.hisp.dhis.program.ProgramIndicator.*;
 
 import java.util.Collection;
 import java.util.Date;
@@ -62,7 +61,6 @@
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
 import org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValue;
 import org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValueService;
-import org.joda.time.DateTime;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;