Salome HOME
b5dedd12b7846154d3886d3bb00754e3d1db43b9
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / UsedByRelation.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 UsedByRelation extends Relation {
13
14     private Document  refer;
15
16 //  ==============================================================================================================================
17 //  Constructors
18 //  ==============================================================================================================================
19
20 //  Database fetch constructor
21     protected UsedByRelation () {
22     }
23 //  Initialization constructors
24     protected UsedByRelation (Document from, Document to) {
25 //  -----------------------------------------------------
26       super(from);
27       this.refer   = to;
28       this.reverse = new UsesRelation(this, to, from);
29     }
30 //  Internal constructor
31     protected UsedByRelation (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 UsesRelation.class;
45     }
46     public Document getTo () {
47 //  -------------------------
48       return refer;
49     }
50     public boolean isBidirectional () {
51 //  ---------------------------------
52       return true;
53     }
54     protected void setTo (Persistent to) {
55 //  ------------------------------------
56       refer = (Document)to;
57     }
58 }