Skip to content

Instantly share code, notes, and snippets.

@PatrickKwinten
Created November 11, 2016 12:12
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/a001bf35e38181f338886cd5d76a1359 to your computer and use it in GitHub Desktop.
Save PatrickKwinten/a001bf35e38181f338886cd5d76a1359 to your computer and use it in GitHub Desktop.
Profile 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("profile")
public interface Profile extends DVertexFrame {
@Property("$$Key")
public String getKey();
/*
* Optional fields
*/
@Property("Name")
public String getName();
@Property("Name")
public void setName(String n);
@Property("Department")
public String getDepartment();
@Property("Department")
public void setDepartment(String n);
@Property("Location")
public String getLocation();
@Property("Location")
public void setLocation(String n);
@Property("Job")
public String getJob();
@Property("Job")
public void setJob(String n);
@Property("Email")
public String getMail();
@Property("Email")
public void setMail(String n);
/*
* Edges e.g. relations
* Note the direction might seem to go the incorrect direction
* (Profile) - [:hasWritten] -> (Post)
*/
@AdjacencyUnique(label = "hasWritten", direction = Direction.IN)
public void addTopic(Post post);
@AdjacencyUnique(label = "hasWritten", direction = Direction.IN)
public void removeTopic(Post post);
@AdjacencyUnique(label = "hasWritten", direction = Direction.IN)
public Iterable<Post> getPosts();
@AdjacencyUnique(label = "hasResponded", 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