Skip to content

Instantly share code, notes, and snippets.

@PatrickKwinten
Created November 11, 2016 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatrickKwinten/330a4b42aaa01338d6449243bd0b6997 to your computer and use it in GitHub Desktop.
Save PatrickKwinten/330a4b42aaa01338d6449243bd0b6997 to your computer and use it in GitHub Desktop.
Post object class
package com.wordpress.quintessens.graph.teamroom;
/*
* Author Patrick Kwinten http://quintessens.wordpress.com
*/
import org.openntf.domino.graph2.annotations.AdjacencyUnique;
import org.openntf.domino.graph2.builtin.DVertexFrame;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.frames.Property;
import com.tinkerpop.frames.modules.typedgraph.TypeValue;
@TypeValue("post")
public interface Post extends DVertexFrame {
@Property("$$Key")
public String getKey();
/*
* Optional fields
*/
@Property("subject")
public String getSubject();
@Property("subject")
public void setSubject(String n);
@Property("abstract")
public String getAbstract();
@Property("abstract")
public void setAbstract(String n);
/*
* Edges e.g. relations
* Note the direction might seem to go the incorrect direction
* (Post) - [:hasReaction] -> (Response)
*/
@AdjacencyUnique(label = "hasWritten", direction = Direction.OUT)
public Iterable<Profile> getAuthors();
@AdjacencyUnique(label = "hasReaction", direction = Direction.IN)
public void addResponse(Response response);
@AdjacencyUnique(label = "hasReaction", direction = Direction.IN)
public void removeResponse(Response response);
@AdjacencyUnique(label = "hasReaction", direction = Direction.IN)
public Iterable<Response> getResponses();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment