← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14986: set autoFields in constructors

 

------------------------------------------------------------
revno: 14986
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-25 17:07:12 +0545
message:
  set autoFields in constructors
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/DataDictionary.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.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/datadictionary/DataDictionary.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/DataDictionary.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/DataDictionary.java	2014-04-25 11:22:12 +0000
@@ -74,10 +74,12 @@
 
     public DataDictionary()
     {
+        setAutoFields();
     }
 
     public DataDictionary( String name, String description, String region )
     {
+        this();
         this.name = name;
         this.description = description;
         this.region = region;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java	2014-04-25 11:22:12 +0000
@@ -63,10 +63,12 @@
 
     public CategoryOptionGroup()
     {
+        setAutoFields();
     }
 
     public CategoryOptionGroup( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java	2014-04-25 11:22:12 +0000
@@ -67,10 +67,12 @@
 
     public CategoryOptionGroupSet()
     {
+        setAutoFields();
     }
 
     public CategoryOptionGroupSet( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2014-04-21 16:43:24 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2014-04-25 11:22:12 +0000
@@ -212,10 +212,12 @@
 
     public DataElement()
     {
+        setAutoFields();
     }
 
     public DataElement( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2014-03-26 18:56:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2014-04-25 11:22:12 +0000
@@ -28,9 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
+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.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseDimensionalObject;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
@@ -41,12 +44,8 @@
 import org.hisp.dhis.common.view.DimensionalView;
 import org.hisp.dhis.common.view.ExportView;
 
-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.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A Category is a dimension of a data element. DataElements can have sets of
@@ -56,7 +55,7 @@
  *
  * @author Abyot Asalefew
  */
-@JacksonXmlRootElement( localName = "category", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement(localName = "category", namespace = DxfNamespaces.DXF_2_0)
 public class DataElementCategory
     extends BaseDimensionalObject
 {
@@ -66,30 +65,32 @@
     private static final long serialVersionUID = 6797241235048185629L;
 
     public static final String DEFAULT_NAME = "default";
-    
+
     private String dataDimensionType;
 
     @Scanned
     private List<DataElementCategoryOption> categoryOptions = new ArrayList<DataElementCategoryOption>();
 
     private boolean dataDimension;
-    
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
 
     public DataElementCategory()
     {
+        setAutoFields();
     }
 
     public DataElementCategory( String name )
     {
+        this();
         this.name = name;
     }
 
     public DataElementCategory( String name, List<DataElementCategoryOption> categoryOptions )
     {
-        this.name = name;
+        this( name );
         this.categoryOptions = categoryOptions;
     }
 
@@ -131,7 +132,7 @@
 
         return null;
     }
-    
+
     public boolean isDefault()
     {
         return DEFAULT_NAME.equals( name );
@@ -143,15 +144,15 @@
 
     @Override
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( { DetailedView.class, DimensionalView.class } )
-    @JacksonXmlElementWrapper( localName = "items", namespace = DxfNamespaces.DXF_2_0 )
-    @JacksonXmlProperty( localName = "item", namespace = DxfNamespaces.DXF_2_0 )
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, DimensionalView.class })
+    @JacksonXmlElementWrapper(localName = "items", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "item", namespace = DxfNamespaces.DXF_2_0)
     public List<NameableObject> getItems()
     {
         return new ArrayList<NameableObject>( categoryOptions );
     }
-    
+
     // ------------------------------------------------------------------------
     // Logic
     // ------------------------------------------------------------------------
@@ -193,10 +194,10 @@
     }
 
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "categoryOptions", namespace = DxfNamespaces.DXF_2_0 )
-    @JacksonXmlProperty( localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0 )
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlElementWrapper(localName = "categoryOptions", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0)
     public List<DataElementCategoryOption> getCategoryOptions()
     {
         return categoryOptions;
@@ -208,8 +209,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public boolean isDataDimension()
     {
         return dataDimension;
@@ -219,7 +220,7 @@
     {
         this.dataDimension = dataDimension;
     }
-    
+
     @Override
     public void mergeWith( IdentifiableObject other )
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java	2014-04-25 11:22:12 +0000
@@ -61,7 +61,7 @@
     private static final long serialVersionUID = 1549406078091077760L;
 
     public static final String DEFAULT_CATEGORY_COMBO_NAME = "default";
-    
+
     public static final String DIMENSION_TYPE_DISAGGREGATION = "disaggregation";
     public static final String DIMENSION_TYPE_ATTTRIBUTE = "attribute";
 
@@ -80,23 +80,25 @@
     private String dimensionType;
 
     private boolean skipTotal;
-    
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
 
     public DataElementCategoryCombo()
     {
+        setAutoFields();
     }
 
     public DataElementCategoryCombo( String name )
     {
+        this();
         this.name = name;
     }
 
     public DataElementCategoryCombo( String name, List<DataElementCategory> categories )
     {
-        this.name = name;
+        this( name );
         this.categories = categories;
     }
 
@@ -171,7 +173,8 @@
         CombinationGenerator<DataElementCategoryOption> generator =
             new CombinationGenerator<DataElementCategoryOption>( getCategoryOptionsAsArray() );
 
-        sortLoop: while ( generator.hasNext() )
+        sortLoop:
+        while ( generator.hasNext() )
         {
             List<DataElementCategoryOption> categoryOptions = generator.getNext();
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2014-03-31 13:30:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2014-04-25 11:22:12 +0000
@@ -72,10 +72,12 @@
 
     public DataElementCategoryOption()
     {
+        setAutoFields();
     }
 
     public DataElementCategoryOption( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2014-04-25 11:22:12 +0000
@@ -89,6 +89,7 @@
 
     public DataElementCategoryOptionCombo()
     {
+        setAutoFields();
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java	2014-04-25 11:22:12 +0000
@@ -75,10 +75,12 @@
 
     public DataElementGroup()
     {
+        setAutoFields();
     }
 
     public DataElementGroup( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2014-04-25 08:33:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2014-04-25 11:22:12 +0000
@@ -79,25 +79,26 @@
 
     public DataElementGroupSet()
     {
+        setAutoFields();
     }
 
     public DataElementGroupSet( String name )
     {
+        this();
         this.name = name;
         this.compulsory = false;
     }
 
     public DataElementGroupSet( String name, Boolean compulsory )
     {
-        this.name = name;
+        this( name );
         this.compulsory = compulsory;
     }
 
     public DataElementGroupSet( String name, String description, Boolean compulsory )
     {
-        this.name = name;
+        this( name, compulsory );
         this.description = description;
-        this.compulsory = compulsory;
     }
 
     public DataElementGroupSet( String name, String description, boolean compulsory, boolean dataDimension )
@@ -115,7 +116,7 @@
         members.add( dataElementGroup );
         dataElementGroup.setGroupSet( this );
     }
-    
+
     public void removeDataElementGroup( DataElementGroup dataElementGroup )
     {
         members.remove( dataElementGroup );
@@ -254,8 +255,8 @@
     }
 
     @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public boolean isDataDimension()
     {
         return dataDimension;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2014-04-25 11:22:12 +0000
@@ -109,6 +109,7 @@
 
     public DataElementOperand()
     {
+        setAutoFields();
     }
 
     public DataElementOperand( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2014-04-03 17:22:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2014-04-25 11:22:12 +0000
@@ -124,7 +124,7 @@
      * The Sections associated with the DataSet.
      */
     private Set<Section> sections = new HashSet<Section>();
-    
+
     /**
      * The CategoryCombo used for data attributes.
      */
@@ -208,7 +208,7 @@
      * can be completed.
      */
     private boolean validCompleteOnly;
-    
+
     /**
      * Property indicating whether a comment is required for all fields in a form
      * which are not entered, including false for boolean values.
@@ -247,32 +247,31 @@
 
     public DataSet()
     {
+        setAutoFields();
     }
 
     public DataSet( String name )
     {
+        this();
         this.name = name;
     }
 
     public DataSet( String name, PeriodType periodType )
     {
-        this.name = name;
+        this( name );
         this.periodType = periodType;
     }
 
     public DataSet( String name, String shortName, PeriodType periodType )
     {
-        this.name = name;
+        this( name, periodType );
         this.shortName = shortName;
-        this.periodType = periodType;
     }
 
     public DataSet( String name, String shortName, String code, PeriodType periodType )
     {
-        this.name = name;
-        this.shortName = shortName;
+        this( name, shortName, periodType );
         this.code = code;
-        this.periodType = periodType;
     }
 
     // -------------------------------------------------------------------------
@@ -406,23 +405,23 @@
     }
 
     /**
-     * Returns all organisation units assigned to this data set, including 
+     * Returns all organisation units assigned to this data set, including
      * org units assigned directly and organisation units assigned through groups.
      */
     public Set<OrganisationUnit> getAllOrganisationUnits()
     {
         Set<OrganisationUnit> units = new HashSet<OrganisationUnit>();
-        
+
         units.addAll( sources );
-        
+
         for ( OrganisationUnitGroup group : organisationUnitGroups )
         {
             units.addAll( group.getMembers() );
         }
-        
+
         return units;
     }
-    
+
     public boolean hasDataEntryForm()
     {
         return dataEntryForm != null;
@@ -473,7 +472,7 @@
     public Set<CategoryOptionGroupSet> getCategoryOptionGroupSets()
     {
         Set<CategoryOptionGroupSet> groupSets = new HashSet<CategoryOptionGroupSet>();
-        
+
         if ( categoryCombo != null )
         {
             for ( DataElementCategory category : categoryCombo.getCategories() )
@@ -484,10 +483,10 @@
                 }
             }
         }
-        
+
         return groupSets;
     }
-    
+
     /**
      * Indicates whether this data set has a category combination which is different
      * from the default category combination.
@@ -510,7 +509,7 @@
     @JsonProperty
     @JsonSerialize( using = JacksonPeriodTypeSerializer.class )
     @JsonDeserialize( using = JacksonPeriodTypeDeserializer.class )
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public PeriodType getPeriodType()
     {
@@ -523,7 +522,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public DataEntryForm getDataEntryForm()
     {
@@ -537,7 +536,7 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "dataElements", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "dataElement", namespace = DxfNamespaces.DXF_2_0 )
     public Set<DataElement> getDataElements()
@@ -552,7 +551,7 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "indicators", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "indicator", namespace = DxfNamespaces.DXF_2_0 )
     public Set<Indicator> getIndicators()
@@ -566,7 +565,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "compulsoryDataElementOperands", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "compulsoryDataElementOperand", namespace = DxfNamespaces.DXF_2_0 )
     public Set<DataElementOperand> getCompulsoryDataElementOperands()
@@ -581,7 +580,7 @@
 
     @JsonProperty( value = "organisationUnits" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView({ DetailedView.class, ExportView.class })
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
     public Set<OrganisationUnit> getSources()
@@ -596,7 +595,7 @@
 
     @JsonProperty( value = "organisationUnitGroups" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "organisationUnitGroups", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "organisationUnitGroup", namespace = DxfNamespaces.DXF_2_0 )
     public Set<OrganisationUnitGroup> getOrganisationUnitGroups()
@@ -621,7 +620,7 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView({ DetailedView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "sections", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "section", namespace = DxfNamespaces.DXF_2_0 )
     public Set<Section> getSections()
@@ -637,7 +636,7 @@
     @JsonProperty
     @JsonSerialize( as = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public DataElementCategoryCombo getCategoryCombo()
     {
         return categoryCombo;
@@ -649,7 +648,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isMobile()
     {
@@ -662,7 +661,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Integer getVersion()
     {
@@ -675,7 +674,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getExpiryDays()
     {
@@ -688,7 +687,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getTimelyDays()
     {
@@ -701,7 +700,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isSkipAggregation()
     {
@@ -714,7 +713,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public UserGroup getNotificationRecipients()
     {
@@ -727,7 +726,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isNotifyCompletingUser()
     {
@@ -740,7 +739,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isApproveData()
     {
@@ -754,8 +753,8 @@
 
     @JsonProperty( value = "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;
@@ -780,7 +779,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isFieldCombinationRequired()
     {
@@ -793,7 +792,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isValidCompleteOnly()
     {
@@ -806,7 +805,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isNoValueRequiresComment()
     {
@@ -819,7 +818,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isSkipOffline()
     {
@@ -832,7 +831,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isRenderAsTabs()
     {
@@ -845,7 +844,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isRenderHorizontally()
     {
@@ -858,7 +857,7 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isDataElementDecoration()
     {
@@ -872,8 +871,8 @@
 
     @JsonProperty
     @JsonSerialize( as = BaseIdentifiableObject.class )
-    @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public MapLegendSet getLegendSet()
     {
         return legendSet;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2014-04-25 11:22:12 +0000
@@ -93,7 +93,12 @@
      * The legend set for this indicator.
      */
     private MapLegendSet legendSet;
-    
+
+    public Indicator()
+    {
+        setAutoFields();
+    }
+
     // -------------------------------------------------------------------------
     // Logic
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java	2014-04-25 11:22:12 +0000
@@ -73,10 +73,12 @@
 
     public IndicatorGroup()
     {
+        setAutoFields();
     }
 
     public IndicatorGroup( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2014-04-25 11:22:12 +0000
@@ -54,7 +54,7 @@
  *
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement( localName = "indicatorGroupSet", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement(localName = "indicatorGroupSet", namespace = DxfNamespaces.DXF_2_0)
 public class IndicatorGroupSet
     extends BaseIdentifiableObject
 {
@@ -76,25 +76,26 @@
 
     public IndicatorGroupSet()
     {
+        setAutoFields();
     }
 
     public IndicatorGroupSet( String name )
     {
+        this();
         this.name = name;
         this.compulsory = false;
     }
 
     public IndicatorGroupSet( String name, Boolean compulsory )
     {
-        this.name = name;
+        this( name );
         this.compulsory = compulsory;
     }
 
     public IndicatorGroupSet( String name, String description, Boolean compulsory )
     {
-        this.name = name;
+        this( name, compulsory );
         this.description = description;
-        this.compulsory = compulsory;
     }
 
     // -------------------------------------------------------------------------
@@ -167,7 +168,7 @@
         members.add( indicatorGroup );
         indicatorGroup.setGroupSet( this );
     }
-    
+
     public void removeIndicatorGroup( IndicatorGroup indicatorGroup )
     {
         members.remove( indicatorGroup );
@@ -185,8 +186,8 @@
     }
 
     @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public String getDescription()
     {
         return description;
@@ -198,8 +199,8 @@
     }
 
     @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public Boolean isCompulsory()
     {
         if ( compulsory == null )
@@ -215,11 +216,11 @@
         this.compulsory = compulsory;
     }
 
-    @JsonProperty( value = "indicatorGroups" )
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "indicatorGroups", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "indicatorGroup", namespace = DxfNamespaces.DXF_2_0)
+    @JsonProperty(value = "indicatorGroups")
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlElementWrapper(localName = "indicatorGroups", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "indicatorGroup", namespace = DxfNamespaces.DXF_2_0)
     public List<IndicatorGroup> getMembers()
     {
         return members;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorType.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorType.java	2014-04-25 11:22:12 +0000
@@ -60,10 +60,12 @@
 
     public IndicatorType()
     {
+        setAutoFields();
     }
 
     public IndicatorType( String name, int factor, Boolean number )
     {
+        this();
         this.name = name;
         this.factor = factor;
         this.number = number;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2014-04-11 07:50:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2014-04-25 11:22:12 +0000
@@ -156,6 +156,7 @@
     public OrganisationUnit()
     {
         this.uuid = UUID.randomUUID().toString();
+        setAutoFields();
     }
 
     public OrganisationUnit( String name )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java	2014-04-25 11:22:12 +0000
@@ -82,10 +82,12 @@
 
     public OrganisationUnitGroup()
     {
+        setAutoFields();
     }
 
     public OrganisationUnitGroup( String name )
     {
+        this();
         this.name = name;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2014-04-25 11:22:12 +0000
@@ -87,10 +87,12 @@
 
     public OrganisationUnitGroupSet()
     {
+        setAutoFields();
     }
 
     public OrganisationUnitGroupSet( String name, String description, boolean compulsory )
     {
+        this();
         this.name = name;
         this.description = description;
         this.compulsory = compulsory;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-04-06 15:48:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-04-25 11:22:12 +0000
@@ -148,10 +148,12 @@
 
     public Program()
     {
+        setAutoFields();
     }
 
     public Program( String name, String description )
     {
+        this();
         this.name = name;
         this.description = description;
     }