Skip to content

Instantly share code, notes, and snippets.

@phatduckk
Created September 8, 2012 01:37
Show Gist options
  • Select an option

  • Save phatduckk/3671210 to your computer and use it in GitHub Desktop.

Select an option

Save phatduckk/3671210 to your computer and use it in GitHub Desktop.
// entity is pretty much a pojo
@Entity(value = "activityStream", noClassnameStored = true)
public class ActivityStream extends BaseEntity {
private String userId;
private String todoId;
private String todoListId;
private String suggestionId;
private String actorId;
private ActivityType activityType; // turned into an int before inserting
...getters...
...setters...
}
// basic insert using Morphia
public class ActivityStreamDao extends BaseDao<ActivityStream, ObjectId> {
@Override
public Key<ActivityStream> save(ActivityStream entity) {
return super.save(entity, WriteConcern.NONE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment