Roberto Sánchez
2013-12-26 d0cb11fcb8aa56081291f40746ec1c85844ed6a5
securis/src/main/java/net/curisit/securis/db/License.java
....@@ -5,6 +5,7 @@
55
66 import javax.persistence.Column;
77 import javax.persistence.Entity;
8
+import javax.persistence.GeneratedValue;
89 import javax.persistence.Id;
910 import javax.persistence.JoinColumn;
1011 import javax.persistence.ManyToOne;
....@@ -24,12 +25,13 @@
2425 @Entity
2526 @Table(name = "license")
2627 @NamedQueries(
27
- { @NamedQuery(name = "list-licenses", query = "SELECT pa FROM Pack pa") })
28
+ { @NamedQuery(name = "list-licenses", query = "SELECT l FROM License l") })
2829 public class License implements Serializable {
2930
3031 private static final long serialVersionUID = 1L;
3132
3233 @Id
34
+ @GeneratedValue
3335 private int id;
3436
3537 private String code;
....@@ -42,8 +44,8 @@
4244 private Organization organization;
4345
4446 @ManyToOne
45
- @JoinColumn(name = "license_type_id")
46
- private LicenseType licenseType;
47
+ @JoinColumn(name = "pack_id")
48
+ private Pack pack;
4749
4850 @ManyToOne
4951 @JoinColumn(name = "created_by")
....@@ -79,14 +81,6 @@
7981 this.organization = organization;
8082 }
8183
82
- public LicenseType getLicenseType() {
83
- return licenseType;
84
- }
85
-
86
- public void setLicenseType(LicenseType licenseType) {
87
- this.licenseType = licenseType;
88
- }
89
-
9084 public User getCreatedBy() {
9185 return createdBy;
9286 }
....@@ -103,4 +97,12 @@
10397 this.numLicenses = numLicenses;
10498 }
10599
100
+ public Pack getPack() {
101
+ return pack;
102
+ }
103
+
104
+ public void setPack(Pack pack) {
105
+ this.pack = pack;
106
+ }
107
+
106108 }