server/src/main/java/org/iri_research/renkan/models/Edge.java
author ymh <ymh.work@gmail.com>
Tue, 25 Dec 2012 21:29:11 +0100
changeset 47 267d67791e05
parent 46 server/src/main/java/org/iri_research/renkan/models/Relation.java@7e132e2a48ca
child 60 6a3084c7eb98
permissions -rw-r--r--
first stabilization of editing a renkan. No collaborative capacities yet.

package org.iri_research.renkan.models;

import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;


@Document(collection="edges")
public class Edge extends AbstractRenkanModel<String> {

	@DBRef
	private Node from;
	
	@DBRef
	private Node to;
	
	private String project_id;
	
	private String created_by;
	

	public Edge(String id, String title, String description, String uri, Node from, Node to, String created_by, String project_id) {
		super(id,title, description, uri);
		this.from = from;
		this.to = to;
		this.created_by = created_by;
		this.project_id = project_id;
	}


	public String getProject_id() {
		return project_id;
	}


	public String getCreated_by() {
		return created_by;
	}
	
	public String getFrom() {
		if(this.from != null) {
			return this.from.id;
		}
		else {
			return null;
		}
	}

	public String getTo() {
		if(this.to != null) {
			return this.to.id;
		}
		else {
			return null;
		}
	}

}