=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java 2015-10-14 04:42:43 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java 2015-12-01 10:19:46 +0000 @@ -32,28 +32,24 @@ import com.fasterxml.jackson.annotation.JsonView; 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.DisplayDensity; import org.hisp.dhis.common.DxfNamespaces; import org.hisp.dhis.common.view.DetailedView; import org.hisp.dhis.common.view.ExportView; -import java.io.Serializable; +import java.util.Objects; /** * @author Bharath Kumar */ @JacksonXmlRootElement( localName = "dataEntryForm", namespace = DxfNamespaces.DXF_2_0 ) public class DataEntryForm - implements Serializable + extends BaseIdentifiableObject { public static final int CURRENT_FORMAT = 2; /** - * The unique identifier for this DataEntryForm - */ - private int id; - - /** * Name of DataEntryForm. Required and unique. */ private String name; @@ -83,13 +79,12 @@ public DataEntryForm( String name ) { - this.name = name; + this(name,null); } public DataEntryForm( String name, String htmlCode ) { - this.name = name; - this.htmlCode = htmlCode; + this(name,null,htmlCode); } public DataEntryForm( String name, DisplayDensity style, String htmlCode ) @@ -115,33 +110,30 @@ // hashCode and equals // ------------------------------------------------------------------------- - @Override - public int hashCode() + @Override public int hashCode() { - return name.hashCode(); + return 31 * super.hashCode() + Objects.hash( name, style, htmlCode, format ); } - @Override - public boolean equals( Object o ) + @Override public boolean equals( Object obj ) { - if ( this == o ) + if ( this == obj ) { return true; } - - if ( o == null ) - { - return false; - } - - if ( !(o instanceof DataEntryForm) ) - { - return false; - } - - final DataEntryForm other = (DataEntryForm) o; - - return name.equals( other.getName() ); + if ( obj == null || getClass() != obj.getClass() ) + { + return false; + } + if ( !super.equals( obj ) ) + { + return false; + } + final DataEntryForm other = (DataEntryForm) obj; + return Objects.equals( this.name, other.name ) + && Objects.equals( this.style, other.style ) + && Objects.equals( this.htmlCode, other.htmlCode ) + && Objects.equals( this.format, other.format ); } @Override @@ -154,16 +146,6 @@ // Getters and setters // ------------------------------------------------------------------------- - public int getId() - { - return id; - } - - public void setId( int id ) - { - this.id = id; - } - @JsonProperty @JsonView( { DetailedView.class, ExportView.class } ) @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java 2015-11-17 09:50:47 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java 2015-12-01 10:19:46 +0000 @@ -117,7 +117,7 @@ if ( count > 0 ) { - log.info( count + " last updated set on " + table ); + log.info( count + " lastupdated set on " + table ); } count = 0; === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2015-11-30 03:36:54 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2015-12-01 10:19:46 +0000 @@ -1453,6 +1453,7 @@ programrulevariable relationshiptype sqlview + dataentryform === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataentryform/hibernate/DataEntryForm.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataentryform/hibernate/DataEntryForm.hbm.xml 2015-09-15 11:43:48 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataentryform/hibernate/DataEntryForm.hbm.xml 2015-12-01 10:19:46 +0000 @@ -1,7 +1,9 @@ + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" + [] + > @@ -11,6 +13,7 @@ + &identifiableProperties;