Created
November 11, 2016 12:09
-
-
Save PatrickKwinten/330a4b42aaa01338d6449243bd0b6997 to your computer and use it in GitHub Desktop.
Post object class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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