~ubuntu-branches/ubuntu/trusty/libjgraph-java/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * $Id: JGraphSQLRelation.java,v 1.1.1.1 2005/08/06 05:26:45 gaudenz Exp $
 * 
 * Copyright (c) 2001-2005, Gaudenz Alder
 * 
 * See LICENSE file in distribution for licensing details of this source file
 */
package com.jgraph.example.adapter;

/**
 * A business object that represents a relation between two entities.
 */
public class JGraphSQLRelation extends JGraphSQLEntity {

	protected JGraphSQLEntity source, target;

	public JGraphSQLRelation() {
		this(null);
	}

	public JGraphSQLRelation(Object userObject) {
		this(userObject, null, null, null, null);
	}

	public JGraphSQLRelation(Object id, JGraphSQLEntity parent,
			JGraphSQLEntity source, JGraphSQLEntity target) {
		this(null, id, parent, source, target);
	}

	public JGraphSQLRelation(Object userObject, Object id,
			JGraphSQLEntity parent, JGraphSQLEntity source,
			JGraphSQLEntity target) {
		super(userObject, id, parent);
		setSource(source);
		setTarget(target);
	}

	/**
	 * @return Returns the source.
	 */
	public JGraphSQLEntity getSource() {
		return source;
	}

	/**
	 * @param source
	 *            The source to set.
	 */
	public void setSource(JGraphSQLEntity source) {
		this.source = source;
	}

	/**
	 * @return Returns the target.
	 */
	public JGraphSQLEntity getTarget() {
		return target;
	}

	/**
	 * @param target
	 *            The target to set.
	 */
	public void setTarget(JGraphSQLEntity target) {
		this.target = target;
	}

}