package com.capitalone.dashboard.model;

import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;

/**
 * Base class for all Mongo model classes that has an id property.
 */
public class BaseModel {
    @Id
    private ObjectId id;

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BaseModel other = (BaseModel) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
    
    
}

@@ -374,655 +374,222 @@
  %7D%0A%0A
-%09/* (non-Javadoc)%0A%09 * @see java.lang.Object#hashCode()%0A%09 */%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09final int prime = 31;%0A%09%09int result = 1;%0A%09%09result = prime * result + ((id == null) ? 0 : id.
+    /*%0A     * Note:%0A     * %0A     * Having 
 hash
-Code());%0A%09%09return result;%0A%09%7D%0A%0A%09/* (non-Javadoc)%0A%09 * @see java.lang.Object#equals(java.lang.
+code + equals is more complicated than simply comparing 
 Object
-)%0A%09 */%0A%09@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09if (this == obj)%0A%09%09%09return true;%0A%09%09if (obj == null)%0A%09%09%09return false;%0A%09%09if (getClass() != obj.getClass())%0A%09%09%09return false;%0A%09%09BaseModel other = (BaseModel) obj;%0A%09%09if (id == null) %7B%0A%09%09%09if (other.id != null)%0A%09%09%09%09return false;%0A%09%09%7D else if (!id.equals(other.id))%0A%09%09%09return false;%0A%09%09return true;%0A%09%7D%0A    %0A    
+Ids since%0A     * it does not provide a way to properly compare models that have not been saved yet.%0A     */
 %0A%7D%0A

Revert change to add hashcode+equals to BaseModel due to unintended side effects