/**
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 * If a copy of the MPL was not distributed with this file, You can obtain one at
 * http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is also subject to the terms of the Health-Related Additional
 * Disclaimer of Warranty and Limitation of Liability available at
 * http://www.carewebframework.org/licensing/disclaimer.
 */
package org.carewebframework.api.domain;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

/**
 * Abstract base class for implementing domain objects. This class is useful for implementing a
 * domain object from scratch. To wrap an existing domain object, use DomainObjectProxy.
 */
public abstract class DomainObject implements Serializable, IDomainObject {

    private static final long serialVersionUID = 1L;

    private String id;

    public DomainObject() {
    }

    public DomainObject(String id) {
        this.id = id;
    }

    @Override
    public String getDomainId() {
        return id;
    }

    @Override
    public void setDomainId(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object object) {
        return object != null && object.getClass().equals(getClass()) && StringUtils.equals(((DomainObject) object).id, id);
    }

    @Override
    public Object getProxiedObject() {
        return this;
    }
}

@@ -803,17 +803,21 @@
 bject %7B%0A
+    
 %0A
-
     priv
@@ -861,17 +861,21 @@
 D = 1L;%0A
+    
 %0A
-
     priv
@@ -889,17 +889,21 @@
 ing id;%0A
+    
 %0A
-
     publ
@@ -924,25 +924,105 @@
 t() %7B%0A    %7D%0A
+    %0A    public DomainObject(DomainObject src) %7B%0A        id = src.id;%0A    %7D%0A    
 %0A
-
     public D
@@ -1066,33 +1066,37 @@
 .id = id;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1144,33 +1144,37 @@
 eturn id;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1232,33 +1232,37 @@
 .id = id;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1433,16 +1433,20 @@
 ;%0A    %7D%0A
+    
 %0A    @Ov

Add copy constructor to DomainObject.