View Javadoc
1   /*
2    * This file is part of ***  M y C o R e  ***
3    * See http://www.mycore.de/ for details.
4    *
5    * MyCoRe is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    *
10   * MyCoRe is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with MyCoRe.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  
19  package org.mycore.backend.jpa.access;
20  
21  import java.sql.Timestamp;
22  
23  import jakarta.persistence.Column;
24  import jakarta.persistence.EmbeddedId;
25  import jakarta.persistence.Entity;
26  import jakarta.persistence.JoinColumn;
27  import jakarta.persistence.ManyToOne;
28  import jakarta.persistence.Table;
29  
30  @Entity
31  @Table(name = "MCRACCESS")
32  public class MCRACCESS {
33      @EmbeddedId
34      private MCRACCESSPK key;
35  
36      @ManyToOne
37      @JoinColumn(name = "rid", nullable = false)
38      private MCRACCESSRULE rule;
39  
40      @Column(name = "CREATOR", length = 64, nullable = false)
41      private String creator;
42  
43      @Column(name = "CREATIONDATE", length = 64, nullable = false)
44      private Timestamp creationdate;
45  
46      public MCRACCESS() {
47      }
48  
49      public MCRACCESS(MCRACCESSPK key) {
50          this.key = new MCRACCESSPK(key.getAcpool(), key.getObjid());
51      }
52  
53      public MCRACCESS(MCRACCESSRULE rule, String acpool, String objid, String creator, Timestamp creationdate) {
54          key = new MCRACCESSPK(acpool, objid);
55          this.rule = rule;
56          this.creator = creator;
57          this.creationdate = creationdate;
58      }
59  
60      public MCRACCESSPK getKey() {
61          return key;
62      }
63  
64      public void setKey(MCRACCESSPK key) {
65          this.key = key;
66      }
67  
68      public Timestamp getCreationdate() {
69          return creationdate;
70      }
71  
72      public void setCreationdate(Timestamp creationdate) {
73          this.creationdate = creationdate;
74      }
75  
76      public String getCreator() {
77          return creator;
78      }
79  
80      public void setCreator(String creator) {
81          this.creator = creator;
82      }
83  
84      public MCRACCESSRULE getRule() {
85          return rule;
86      }
87  
88      public void setRule(MCRACCESSRULE rule) {
89          this.rule = rule;
90      }
91  }