package com.mysema.query.mongodb.domain;

import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;

import java.util.Date;

@Entity
public class Dates {

    private @Id ObjectId id;

    private Date date;

    public ObjectId getId() {
        return id;
    }

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

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
}

@@ -35,16 +35,40 @@
 omain;%0A%0A
+import java.util.Date;%0A%0A
 import o
@@ -91,16 +91,16 @@
 jectId;%0A
-
 import o
@@ -186,32 +186,8 @@
 d;%0A%0A
-import java.util.Date;%0A%0A
 @Ent
@@ -477,24 +477,24 @@
 ate date) %7B%0A
-
         this
@@ -512,11 +512,650 @@
 e;%0A    %7D
+%0A%0A    @Override%0A    public int hashCode() %7B%0A        final int prime = 31;%0A        int result = 1;%0A        result = prime * result + ((id == null) ? 0 : id.hashCode());%0A        return result;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if (this == obj)%0A            return true;%0A        if (obj == null)%0A            return false;%0A        if (getClass() != obj.getClass())%0A            return false;%0A        Dates other = (Dates) obj;%0A        if (id == null) %7B%0A            if (other.id != null)%0A                return false;%0A        %7D else if (!id.equals(other.id))%0A            return false;%0A        return true;%0A    %7D
 %0A%7D%0A

Add equals and hashCode