Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / UsesRelation.java
1 package org.splat.dal.bo.som;
2 /**
3  * 
4  * @author    Daniel Brunier-Coulin
5  * @copyright OPEN CASCADE 2012
6  */
7
8 import org.splat.dal.bo.kernel.Persistent;
9 import org.splat.dal.bo.kernel.Relation;
10
11
12 public class UsesRelation extends Relation {
13
14     private Document  refer;
15
16 //  ==============================================================================================================================
17 //  Constructors
18 //  ==============================================================================================================================
19
20 //  Database fetch constructor
21     protected UsesRelation () {
22     }
23 //  Initialization constructors
24     public UsesRelation (Document from, Document to) {
25 //  ---------------------------------------------------
26       super(from);
27       this.refer   = to;
28       this.reverse = new UsedByRelation(this, to, from);
29     }
30 //  Internal constructor
31     protected UsesRelation (Relation back, Document from, Document to) {
32 //  ------------------------------------------------------------------
33       super(from);
34       this.refer   = to;
35       this.reverse = back;
36     }
37
38 //  ==============================================================================================================================
39 //  Public member functions
40 //  ==============================================================================================================================
41
42     public Class<? extends Relation> getReverseClass () {
43 //  ---------------------------------------------------
44       return UsedByRelation.class;
45     }
46
47     public Document getTo () {
48 //  -------------------------
49       return refer;
50     }
51     public boolean isBidirectional () {
52 //  ---------------------------------
53       return true;
54     }
55     protected void setTo (Persistent to) {
56 //  ------------------------------------
57       refer = (Document)to;
58     }
59 }