Salome HOME
Copyrights update 2015.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / ReaderRelation.java
1 /*****************************************************************************
2  * Company         EURIWARE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   Mar 18, 2013
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.dal.bo.som; 
11
12 import org.splat.dal.bo.kernel.Persistent;
13 import org.splat.dal.bo.kernel.Relation;
14 import org.splat.dal.bo.kernel.User;
15 import org.splat.dal.bo.som.Study;
16
17 /**
18  * Class representing relation of of user to study.
19  */
20 public class ReaderRelation extends Relation {
21
22         /**
23          * User bounded by relation.
24          */
25         private User refer;
26
27 //  ==============================================================================================================================
28 //  Constructors
29 //  ==============================================================================================================================
30
31     /**
32      * Database fetch constructor.
33      */
34     public ReaderRelation() {
35         super();
36     }
37
38     /**
39      * ReaderRelation subclasses constructor.
40      * @param from the study
41      * @param to the user
42      */
43     public ReaderRelation(final Study from, final User to) {
44         super(from);
45         this.refer = to;
46     }
47
48 //  ==============================================================================================================================
49 //  Public member functions
50 //  ==============================================================================================================================
51
52     /** 
53          * {@inheritDoc}
54          * @see org.splat.dal.bo.kernel.Relation#getTo()
55          */
56         @Override
57         public Persistent getTo() {
58                 return refer;
59         }
60
61         /** 
62          * {@inheritDoc}
63          * @see org.splat.dal.bo.kernel.Relation#setTo(org.splat.dal.bo.kernel.Persistent)
64          */
65         @Override
66         public void setTo(Persistent to) {
67                 refer = (User)to;
68         }
69 }