Skip to content

Instantly share code, notes, and snippets.

@AndyBowes
Created July 3, 2012 15:31
Show Gist options
  • Save AndyBowes/3040495 to your computer and use it in GitHub Desktop.
Save AndyBowes/3040495 to your computer and use it in GitHub Desktop.
MondoDB Domain Class
public class Album {
private ObjectId _id;
private String artist;
private String title;
private List<Song> tracks;
public ObjectId getId() {
return _id;
}
public void setId(ObjectId id) {
this._id = id;
}
... Standard Accessors/Mutators ...
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Album album = (Album) o;
if (!_id.equals(album._id)) return false;
return true;
}
@Override
public int hashCode() {
return _id.hashCode();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment