| .. | .. |
|---|
| 5 | 5 | |
|---|
| 6 | 6 | import javax.persistence.Column; |
|---|
| 7 | 7 | import javax.persistence.Entity; |
|---|
| 8 | +import javax.persistence.GeneratedValue; |
|---|
| 8 | 9 | import javax.persistence.Id; |
|---|
| 9 | 10 | import javax.persistence.JoinColumn; |
|---|
| 10 | 11 | import javax.persistence.ManyToOne; |
|---|
| .. | .. |
|---|
| 24 | 25 | @Entity |
|---|
| 25 | 26 | @Table(name = "license") |
|---|
| 26 | 27 | @NamedQueries( |
|---|
| 27 | | - { @NamedQuery(name = "list-licenses", query = "SELECT pa FROM Pack pa") }) |
|---|
| 28 | + { @NamedQuery(name = "list-licenses", query = "SELECT l FROM License l") }) |
|---|
| 28 | 29 | public class License implements Serializable { |
|---|
| 29 | 30 | |
|---|
| 30 | 31 | private static final long serialVersionUID = 1L; |
|---|
| 31 | 32 | |
|---|
| 32 | 33 | @Id |
|---|
| 34 | + @GeneratedValue |
|---|
| 33 | 35 | private int id; |
|---|
| 34 | 36 | |
|---|
| 35 | 37 | private String code; |
|---|
| .. | .. |
|---|
| 42 | 44 | private Organization organization; |
|---|
| 43 | 45 | |
|---|
| 44 | 46 | @ManyToOne |
|---|
| 45 | | - @JoinColumn(name = "license_type_id") |
|---|
| 46 | | - private LicenseType licenseType; |
|---|
| 47 | + @JoinColumn(name = "pack_id") |
|---|
| 48 | + private Pack pack; |
|---|
| 47 | 49 | |
|---|
| 48 | 50 | @ManyToOne |
|---|
| 49 | 51 | @JoinColumn(name = "created_by") |
|---|
| .. | .. |
|---|
| 79 | 81 | this.organization = organization; |
|---|
| 80 | 82 | } |
|---|
| 81 | 83 | |
|---|
| 82 | | - public LicenseType getLicenseType() { |
|---|
| 83 | | - return licenseType; |
|---|
| 84 | | - } |
|---|
| 85 | | - |
|---|
| 86 | | - public void setLicenseType(LicenseType licenseType) { |
|---|
| 87 | | - this.licenseType = licenseType; |
|---|
| 88 | | - } |
|---|
| 89 | | - |
|---|
| 90 | 84 | public User getCreatedBy() { |
|---|
| 91 | 85 | return createdBy; |
|---|
| 92 | 86 | } |
|---|
| .. | .. |
|---|
| 103 | 97 | this.numLicenses = numLicenses; |
|---|
| 104 | 98 | } |
|---|
| 105 | 99 | |
|---|
| 100 | + public Pack getPack() { |
|---|
| 101 | + return pack; |
|---|
| 102 | + } |
|---|
| 103 | + |
|---|
| 104 | + public void setPack(Pack pack) { |
|---|
| 105 | + this.pack = pack; |
|---|
| 106 | + } |
|---|
| 107 | + |
|---|
| 106 | 108 | } |
|---|