Salome HOME
Fix for the bug: versioning of a document with uses relations => crash.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / ValidationCycleRelation.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 ValidationCycleRelation extends Relation {
13
14     private  ValidationCycle refer;
15
16 //  ==============================================================================================================================
17 //  Construction
18 //  ==============================================================================================================================
19
20 //  Database fetch constructor
21     protected ValidationCycleRelation () {
22     }
23 //  Internal constructor
24     protected ValidationCycleRelation (Study from, ValidationCycle to) {
25 //  ------------------------------------------------------------------
26       super(from);
27       this.refer  = to;
28     }
29
30 //  ==============================================================================================================================
31 //  Public member functions
32 //  ==============================================================================================================================
33
34 /**
35  * Returns the document type to which the validation cycle referenced by this relation applies. If the referenced validation cycle
36  * is a default one, the associated document type is not defined.
37  * 
38  * @return the document type involved by the referenced validation cycle, or null if this latter is a default one.
39  */
40     public DocumentType getDocumentType () {
41 //  --------------------------------------
42       return refer.getDocumentType();
43     }
44
45     public ValidationCycle getTo () {
46 //  -------------------------------
47       return refer;
48     }
49
50     protected void setTo (Persistent to) {
51 //  ------------------------------------
52       refer = (ValidationCycle)to;
53     }
54 }