1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.mobility.library.entity;
17
18 import java.util.Date;
19
20 import javax.persistence.CascadeType;
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.JoinColumn;
27 import javax.persistence.NamedQueries;
28 import javax.persistence.NamedQuery;
29 import javax.persistence.OneToOne;
30 import javax.persistence.Table;
31 import javax.persistence.Version;
32
33
34
35
36
37
38
39 @NamedQueries({
40
41 @NamedQuery(
42 name="Library.getLibraries",
43 query="SELECT a FROM Library a ORDER BY a.campusCode, a.order ASC "),
44
45 @NamedQuery(
46 name="Library.getLibrariesByIds",
47 query="SELECT a FROM Library a where a.id IN (:libraryIds) ORDER BY a.campusCode, a.order ASC ")
48 })
49 @Entity
50 @Table(name="LIBRARY")
51 public class Library {
52
53
54 @Id
55 @GeneratedValue(strategy = GenerationType.IDENTITY)
56 @Column(name="ID")
57 private long id;
58
59
60
61
62 @Column(name="NAME" , nullable=false)
63 private String name;
64
65
66
67
68 @Column(name="ORDR")
69 private int order;
70
71
72
73
74 @Column(name="CAMPUS_CODE")
75 private String campusCode;
76
77
78
79
80 @OneToOne(optional=false,cascade=CascadeType.ALL)
81 @JoinColumn(name="LIBRARY_CONTACT_ID")
82 private LibraryContactDetail libraryContactDetail;
83
84
85
86
87 @Column(name="ACTIVE")
88 private boolean active;
89
90
91
92
93
94 public long getId() {
95 return id;
96 }
97
98
99
100
101
102 public void setId(long id) {
103 this.id = id;
104 }
105
106
107
108
109
110 public String getName() {
111 return name;
112 }
113
114
115
116
117
118 public void setName(String name) {
119 this.name = name;
120 }
121
122
123
124
125
126 public int getOrder() {
127 return order;
128 }
129
130
131
132
133
134 public void setOrder(int order) {
135 this.order = order;
136 }
137
138
139
140
141
142 public String getCampusCode() {
143 return campusCode;
144 }
145
146
147
148
149
150 public void setCampusCode(String campusCode) {
151 this.campusCode = campusCode;
152 }
153
154
155
156
157
158 public LibraryContactDetail getLibraryContactDetail() {
159 return libraryContactDetail;
160 }
161
162
163
164
165
166 public void setLibraryContactDetail(LibraryContactDetail libraryContactDetail) {
167 this.libraryContactDetail = libraryContactDetail;
168 }
169
170
171
172
173
174 public boolean isActive() {
175 return active;
176 }
177
178
179
180
181
182 public void setActive(boolean active) {
183 this.active = active;
184 }
185
186
187
188
189 }