Commit abdfa866 by tkfftk

not ewerything is working

git-svn-id: https://dev.intra.insomnia.fi/svn/trunk@49 8cf89bec-f6a3-4178-919f-364fb3449fe5
1 parent efa7556f
Showing with 1325 additions and 797 deletions
......@@ -17,6 +17,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
* An access privilege such as a privilege to login or to work with compos.
......@@ -30,8 +31,10 @@ import javax.persistence.Table;
public class AccessRight implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "access_rights_id", nullable = false)
private Integer accessRightsId;
private Integer id;
@Basic(optional = false)
@Column(name = "access_right", nullable = false)
private String accessRight;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "accessRightsId")
......@@ -39,26 +42,23 @@ public class AccessRight implements Serializable {
@OneToMany(mappedBy = "accessRightsId")
private List<RoleRight> roleRightList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public AccessRight() {
}
public AccessRight(Integer accessRightsId) {
this.accessRightsId = accessRightsId;
this.id = accessRightsId;
}
public AccessRight(Integer accessRightsId, String accessRight) {
this.accessRightsId = accessRightsId;
this.id = accessRightsId;
this.accessRight = accessRight;
}
public Integer getAccessRightsId() {
return accessRightsId;
}
public void setAccessRightsId(Integer accessRightsId) {
this.accessRightsId = accessRightsId;
}
public String getAccessRight() {
return accessRight;
}
......@@ -86,7 +86,7 @@ public class AccessRight implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (accessRightsId != null ? accessRightsId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
......@@ -98,9 +98,9 @@ public class AccessRight implements Serializable {
return false;
}
AccessRight other = (AccessRight) object;
if ((this.accessRightsId == null && other.accessRightsId != null)
|| (this.accessRightsId != null && !this.accessRightsId
.equals(other.accessRightsId))) {
if ((this.id == null && other.id != null)
|| (this.id != null && !this.id
.equals(other.id))) {
return false;
}
return true;
......@@ -109,7 +109,7 @@ public class AccessRight implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.AccessRight[accessRightsId="
+ accessRightsId + "]";
+ id + "]";
}
}
......@@ -8,6 +8,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -26,28 +27,29 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "bills")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Bill.findAll", query = "SELECT b FROM Bill b"),
@NamedQuery(name = "Bill.findByBillsId", query = "SELECT b FROM Bill b WHERE b.billsId = :billsId"),
@NamedQuery(name = "Bill.findByDueDate", query = "SELECT b FROM Bill b WHERE b.dueDate = :dueDate"),
@NamedQuery(name = "Bill.findByPaidDate", query = "SELECT b FROM Bill b WHERE b.paidDate = :paidDate"),
@NamedQuery(name = "Bill.findByReferenceNumber", query = "SELECT b FROM Bill b WHERE b.referenceNumber = :referenceNumber"),
@NamedQuery(name = "Bill.findByNotes", query = "SELECT b FROM Bill b WHERE b.notes = :notes") })
@NamedQuery(name = "Bill.findByNotes", query = "SELECT b FROM Bill b WHERE b.notes = :notes")})
public class Bill implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "bills_id", nullable = false)
private Integer billsId;
private Integer id;
@Column(name = "due_date")
@Temporal(TemporalType.TIMESTAMP)
private Date dueDate;
@Column(name = "paid_date")
@Temporal(TemporalType.TIMESTAMP)
private Date paidDate;
@Column(name = "reference_number")
@Column(name = "reference_number", length = 2147483647)
private String referenceNumber;
@Column(name = "notes")
@Column(name = "notes", length = 2147483647)
private String notes;
@OneToMany(mappedBy = "billsId")
private List<BillLine> billLineList;
......@@ -58,19 +60,16 @@ public class Bill implements Serializable {
@ManyToOne(optional = false)
private User usersId;
public Bill() {
}
@Version
@Column(nullable = false)
private int jpaVersionField;
public Bill(Integer billsId) {
this.billsId = billsId;
}
public Integer getBillsId() {
return billsId;
public Bill() {
}
public void setBillsId(Integer billsId) {
this.billsId = billsId;
public Bill(Integer billsId) {
this.id = billsId;
}
public Date getDueDate() {
......@@ -132,20 +131,18 @@ public class Bill implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (billsId != null ? billsId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Bill)) {
return false;
}
Bill other = (Bill) object;
if ((this.billsId == null && other.billsId != null)
|| (this.billsId != null && !this.billsId.equals(other.billsId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -153,6 +150,6 @@ public class Bill implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Bill[billsId=" + billsId + "]";
return "fi.insomnia.bortal.model.Bill[billsId=" + id + "]";
}
}
......@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -22,54 +23,55 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "bill_lines")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "BillLine.findAll", query = "SELECT b FROM BillLine b"),
@NamedQuery(name = "BillLine.findByBillLinesId", query = "SELECT b FROM BillLine b WHERE b.billLinesId = :billLinesId"),
@NamedQuery(name = "BillLine.findByProduct", query = "SELECT b FROM BillLine b WHERE b.product = :product"),
@NamedQuery(name = "BillLine.findByUnits", query = "SELECT b FROM BillLine b WHERE b.units = :units"),
@NamedQuery(name = "BillLine.findByUnitPrice", query = "SELECT b FROM BillLine b WHERE b.unitPrice = :unitPrice"),
@NamedQuery(name = "BillLine.findByVat", query = "SELECT b FROM BillLine b WHERE b.vat = :vat") })
@NamedQuery(name = "BillLine.findByVat", query = "SELECT b FROM BillLine b WHERE b.vat = :vat")})
public class BillLine implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "bill_lines_id", nullable = false)
private Integer billLinesId;
private Integer id;
@Basic(optional = false)
@Column(name = "product", nullable = false, length = 2147483647)
private String product;
@Basic(optional = false)
@Column(name = "units", nullable = false)
private int units;
@Basic(optional = false)
@Column(name = "unit_price", nullable = false)
private float unitPrice;
@Basic(optional = false)
@Column(name = "vat", nullable = false)
private float vat;
@JoinColumn(name = "bills_id", referencedColumnName = "bills_id")
@ManyToOne
private Bill billsId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public BillLine() {
}
public BillLine(Integer billLinesId) {
this.billLinesId = billLinesId;
this.id = billLinesId;
}
public BillLine(Integer billLinesId, String product, int units,
float unitPrice, float vat) {
this.billLinesId = billLinesId;
public BillLine(Integer billLinesId, String product, int units, float unitPrice, float vat) {
this.id = billLinesId;
this.product = product;
this.units = units;
this.unitPrice = unitPrice;
this.vat = vat;
}
public Integer getBillLinesId() {
return billLinesId;
}
public void setBillLinesId(Integer billLinesId) {
this.billLinesId = billLinesId;
}
public String getProduct() {
return product;
}
......@@ -113,21 +115,18 @@ public class BillLine implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (billLinesId != null ? billLinesId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof BillLine)) {
return false;
}
BillLine other = (BillLine) object;
if ((this.billLinesId == null && other.billLinesId != null)
|| (this.billLinesId != null && !this.billLinesId
.equals(other.billLinesId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -135,8 +134,7 @@ public class BillLine implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.BillLine[billLinesId=" + billLinesId
+ "]";
return "fi.insomnia.bortal.model.BillLine[billLinesId=" + id + "]";
}
}
......@@ -8,6 +8,7 @@ package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -25,18 +26,20 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "card_templates")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "CardTemplate.findAll", query = "SELECT c FROM CardTemplate c"),
@NamedQuery(name = "CardTemplate.findByCardTemplatesId", query = "SELECT c FROM CardTemplate c WHERE c.cardTemplatesId = :cardTemplatesId"),
@NamedQuery(name = "CardTemplate.findByTemplateName", query = "SELECT c FROM CardTemplate c WHERE c.templateName = :templateName") })
@NamedQuery(name = "CardTemplate.findByTemplateName", query = "SELECT c FROM CardTemplate c WHERE c.templateName = :templateName")})
public class CardTemplate implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "card_templates_id", nullable = false)
private Integer cardTemplatesId;
private Integer id;
@Lob
@Column(name = "template_image")
private byte[] templateImage;
@Basic(optional = false)
@Column(name = "template_name", nullable = false, length = 2147483647)
private String templateName;
@JoinColumn(name = "events_id", referencedColumnName = "events_id")
......@@ -45,26 +48,23 @@ public class CardTemplate implements Serializable {
@OneToMany(mappedBy = "cardTemplatesId")
private List<Role> roleList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public CardTemplate() {
}
public CardTemplate(Integer cardTemplatesId) {
this.cardTemplatesId = cardTemplatesId;
this.id = cardTemplatesId;
}
public CardTemplate(Integer cardTemplatesId, String templateName) {
this.cardTemplatesId = cardTemplatesId;
this.id = cardTemplatesId;
this.templateName = templateName;
}
public Integer getCardTemplatesId() {
return cardTemplatesId;
}
public void setCardTemplatesId(Integer cardTemplatesId) {
this.cardTemplatesId = cardTemplatesId;
}
public byte[] getTemplateImage() {
return templateImage;
}
......@@ -100,21 +100,18 @@ public class CardTemplate implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (cardTemplatesId != null ? cardTemplatesId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CardTemplate)) {
return false;
}
CardTemplate other = (CardTemplate) object;
if ((this.cardTemplatesId == null && other.cardTemplatesId != null)
|| (this.cardTemplatesId != null && !this.cardTemplatesId
.equals(other.cardTemplatesId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -122,8 +119,7 @@ public class CardTemplate implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.CardTemplate[cardTemplatesId="
+ cardTemplatesId + "]";
return "fi.insomnia.bortal.model.CardTemplate[cardTemplatesId=" + id + "]";
}
}
......@@ -9,6 +9,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -28,7 +29,7 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "compos")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Compo.findAll", query = "SELECT c FROM Compo c"),
@NamedQuery(name = "Compo.findByComposId", query = "SELECT c FROM Compo c WHERE c.composId = :composId"),
@NamedQuery(name = "Compo.findByCompoName", query = "SELECT c FROM Compo c WHERE c.compoName = :compoName"),
......@@ -37,12 +38,14 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "Compo.findByVoteEnd", query = "SELECT c FROM Compo c WHERE c.voteEnd = :voteEnd"),
@NamedQuery(name = "Compo.findBySubmitStart", query = "SELECT c FROM Compo c WHERE c.submitStart = :submitStart"),
@NamedQuery(name = "Compo.findBySubmitEnd", query = "SELECT c FROM Compo c WHERE c.submitEnd = :submitEnd"),
@NamedQuery(name = "Compo.findByHoldVoting", query = "SELECT c FROM Compo c WHERE c.holdVoting = :holdVoting") })
@NamedQuery(name = "Compo.findByHoldVoting", query = "SELECT c FROM Compo c WHERE c.holdVoting = :holdVoting")})
public class Compo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "compos_id", nullable = false)
private Integer composId;
private Integer id;
@Basic(optional = false)
@Column(name = "compo_name", nullable = false, length = 2147483647)
private String compoName;
@Column(name = "compo_start")
......@@ -60,6 +63,7 @@ public class Compo implements Serializable {
@Column(name = "submit_end")
@Temporal(TemporalType.TIMESTAMP)
private Date submitEnd;
@Basic(optional = false)
@Column(name = "hold_voting", nullable = false)
private boolean holdVoting;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "composId")
......@@ -68,27 +72,24 @@ public class Compo implements Serializable {
@ManyToOne(optional = false)
private Event eventsId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Compo() {
}
public Compo(Integer composId) {
this.composId = composId;
this.id = composId;
}
public Compo(Integer composId, String compoName, boolean holdVoting) {
this.composId = composId;
this.id = composId;
this.compoName = compoName;
this.holdVoting = holdVoting;
}
public Integer getComposId() {
return composId;
}
public void setComposId(Integer composId) {
this.composId = composId;
}
public String getCompoName() {
return compoName;
}
......@@ -164,21 +165,18 @@ public class Compo implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (composId != null ? composId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Compo)) {
return false;
}
Compo other = (Compo) object;
if ((this.composId == null && other.composId != null)
|| (this.composId != null && !this.composId
.equals(other.composId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -186,7 +184,7 @@ public class Compo implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Compo[composId=" + composId + "]";
return "fi.insomnia.bortal.model.Compo[composId=" + id + "]";
}
}
......@@ -9,6 +9,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -28,22 +29,25 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "entries")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "CompoEntry.findAll", query = "SELECT c FROM CompoEntry c"),
@NamedQuery(name = "CompoEntry.findByEntriesId", query = "SELECT c FROM CompoEntry c WHERE c.entriesId = :entriesId"),
@NamedQuery(name = "CompoEntry.findByEntryCreated", query = "SELECT c FROM CompoEntry c WHERE c.entryCreated = :entryCreated"),
@NamedQuery(name = "CompoEntry.findByEntryName", query = "SELECT c FROM CompoEntry c WHERE c.entryName = :entryName"),
@NamedQuery(name = "CompoEntry.findByNotes", query = "SELECT c FROM CompoEntry c WHERE c.notes = :notes"),
@NamedQuery(name = "CompoEntry.findByScreenMessage", query = "SELECT c FROM CompoEntry c WHERE c.screenMessage = :screenMessage"),
@NamedQuery(name = "CompoEntry.findBySort", query = "SELECT c FROM CompoEntry c WHERE c.sort = :sort") })
@NamedQuery(name = "CompoEntry.findBySort", query = "SELECT c FROM CompoEntry c WHERE c.sort = :sort")})
public class CompoEntry implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "entries_id", nullable = false)
private Integer entriesId;
private Integer id;
@Basic(optional = false)
@Column(name = "entry_created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date entryCreated;
@Basic(optional = false)
@Column(name = "entry_name", nullable = false, length = 2147483647)
private String entryName;
@Column(name = "notes", length = 2147483647)
......@@ -65,27 +69,24 @@ public class CompoEntry implements Serializable {
@ManyToOne
private User creator;
@Version
@Column(nullable = false)
private int jpaVersionField;
public CompoEntry() {
}
public CompoEntry(Integer entriesId) {
this.entriesId = entriesId;
this.id = entriesId;
}
public CompoEntry(Integer entriesId, Date entryCreated, String entryName) {
this.entriesId = entriesId;
this.id = entriesId;
this.entryCreated = entryCreated;
this.entryName = entryName;
}
public Integer getEntriesId() {
return entriesId;
}
public void setEntriesId(Integer entriesId) {
this.entriesId = entriesId;
}
public Date getEntryCreated() {
return entryCreated;
}
......@@ -146,8 +147,7 @@ public class CompoEntry implements Serializable {
return compoEntryParticipantList;
}
public void setCompoEntryParticipantList(
List<CompoEntryParticipant> compoEntryParticipantList) {
public void setCompoEntryParticipantList(List<CompoEntryParticipant> compoEntryParticipantList) {
this.compoEntryParticipantList = compoEntryParticipantList;
}
......@@ -170,21 +170,18 @@ public class CompoEntry implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (entriesId != null ? entriesId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompoEntry)) {
return false;
}
CompoEntry other = (CompoEntry) object;
if ((this.entriesId == null && other.entriesId != null)
|| (this.entriesId != null && !this.entriesId
.equals(other.entriesId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -192,8 +189,7 @@ public class CompoEntry implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.CompoEntry[entriesId=" + entriesId
+ "]";
return "fi.insomnia.bortal.model.CompoEntry[entriesId=" + id + "]";
}
}
......@@ -8,6 +8,7 @@ package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -26,7 +27,7 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "entry_files")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "CompoEntryFile.findAll", query = "SELECT c FROM CompoEntryFile c"),
@NamedQuery(name = "CompoEntryFile.findByEntryFilesId", query = "SELECT c FROM CompoEntryFile c WHERE c.entryFilesId = :entryFilesId"),
@NamedQuery(name = "CompoEntryFile.findByMimeType", query = "SELECT c FROM CompoEntryFile c WHERE c.mimeType = :mimeType"),
......@@ -34,12 +35,13 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "CompoEntryFile.findByDescription", query = "SELECT c FROM CompoEntryFile c WHERE c.description = :description"),
@NamedQuery(name = "CompoEntryFile.findByHash", query = "SELECT c FROM CompoEntryFile c WHERE c.hash = :hash"),
@NamedQuery(name = "CompoEntryFile.findByComment", query = "SELECT c FROM CompoEntryFile c WHERE c.comment = :comment"),
@NamedQuery(name = "CompoEntryFile.findByUploaded", query = "SELECT c FROM CompoEntryFile c WHERE c.uploaded = :uploaded") })
@NamedQuery(name = "CompoEntryFile.findByUploaded", query = "SELECT c FROM CompoEntryFile c WHERE c.uploaded = :uploaded")})
public class CompoEntryFile implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "entry_files_id", nullable = false)
private Integer entryFilesId;
private Integer id;
@Column(name = "mime_type", length = 2147483647)
private String mimeType;
@Column(name = "file_name", length = 2147483647)
......@@ -53,6 +55,7 @@ public class CompoEntryFile implements Serializable {
@Lob
@Column(name = "file_data")
private byte[] fileData;
@Basic(optional = false)
@Column(name = "uploaded", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date uploaded;
......@@ -60,26 +63,23 @@ public class CompoEntryFile implements Serializable {
@ManyToOne(optional = false)
private CompoEntry entriesId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public CompoEntryFile() {
}
public CompoEntryFile(Integer entryFilesId) {
this.entryFilesId = entryFilesId;
this.id = entryFilesId;
}
public CompoEntryFile(Integer entryFilesId, Date uploaded) {
this.entryFilesId = entryFilesId;
this.id = entryFilesId;
this.uploaded = uploaded;
}
public Integer getEntryFilesId() {
return entryFilesId;
}
public void setEntryFilesId(Integer entryFilesId) {
this.entryFilesId = entryFilesId;
}
public String getMimeType() {
return mimeType;
}
......@@ -147,21 +147,18 @@ public class CompoEntryFile implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (entryFilesId != null ? entryFilesId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompoEntryFile)) {
return false;
}
CompoEntryFile other = (CompoEntryFile) object;
if ((this.entryFilesId == null && other.entryFilesId != null)
|| (this.entryFilesId != null && !this.entryFilesId
.equals(other.entryFilesId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -169,8 +166,7 @@ public class CompoEntryFile implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.CompoEntryFile[entryFilesId="
+ entryFilesId + "]";
return "fi.insomnia.bortal.model.CompoEntryFile[entryFilesId=" + id + "]";
}
}
......@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -22,15 +23,16 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "entry_participations")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "CompoEntryParticipant.findAll", query = "SELECT c FROM CompoEntryParticipant c"),
@NamedQuery(name = "CompoEntryParticipant.findByEntryParticipationsId", query = "SELECT c FROM CompoEntryParticipant c WHERE c.entryParticipationsId = :entryParticipationsId"),
@NamedQuery(name = "CompoEntryParticipant.findByRole", query = "SELECT c FROM CompoEntryParticipant c WHERE c.role = :role") })
@NamedQuery(name = "CompoEntryParticipant.findByRole", query = "SELECT c FROM CompoEntryParticipant c WHERE c.role = :role")})
public class CompoEntryParticipant implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "entry_participations_id", nullable = false)
private Integer entryParticipationsId;
private Integer id;
@Column(name = "role", length = 2147483647)
private String role;
@JoinColumn(name = "entries_id", referencedColumnName = "entries_id", nullable = false)
......@@ -40,19 +42,16 @@ public class CompoEntryParticipant implements Serializable {
@ManyToOne(optional = false)
private User usersId;
public CompoEntryParticipant() {
}
@Version
@Column(nullable = false)
private int jpaVersionField;
public CompoEntryParticipant(Integer entryParticipationsId) {
this.entryParticipationsId = entryParticipationsId;
}
public Integer getEntryParticipationsId() {
return entryParticipationsId;
public CompoEntryParticipant() {
}
public void setEntryParticipationsId(Integer entryParticipationsId) {
this.entryParticipationsId = entryParticipationsId;
public CompoEntryParticipant(Integer entryParticipationsId) {
this.id = entryParticipationsId;
}
public String getRole() {
......@@ -82,22 +81,18 @@ public class CompoEntryParticipant implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (entryParticipationsId != null ? entryParticipationsId
.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompoEntryParticipant)) {
return false;
}
CompoEntryParticipant other = (CompoEntryParticipant) object;
if ((this.entryParticipationsId == null && other.entryParticipationsId != null)
|| (this.entryParticipationsId != null && !this.entryParticipationsId
.equals(other.entryParticipationsId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -105,8 +100,7 @@ public class CompoEntryParticipant implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.CompoEntryParticipant[entryParticipationsId="
+ entryParticipationsId + "]";
return "fi.insomnia.bortal.model.CompoEntryParticipant[entryParticipationsId=" + id + "]";
}
}
......@@ -9,6 +9,7 @@ import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -24,7 +25,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "discounts")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Discount.findAll", query = "SELECT d FROM Discount d"),
@NamedQuery(name = "Discount.findByDiscountsId", query = "SELECT d FROM Discount d WHERE d.discountsId = :discountsId"),
@NamedQuery(name = "Discount.findByPercentage", query = "SELECT d FROM Discount d WHERE d.percentage = :percentage"),
......@@ -34,41 +35,52 @@ import javax.persistence.Table;
@NamedQuery(name = "Discount.findByAmountMax", query = "SELECT d FROM Discount d WHERE d.amountMax = :amountMax"),
@NamedQuery(name = "Discount.findByActive", query = "SELECT d FROM Discount d WHERE d.active = :active"),
@NamedQuery(name = "Discount.findByMaxNum", query = "SELECT d FROM Discount d WHERE d.maxNum = :maxNum"),
@NamedQuery(name = "Discount.findByPerUser", query = "SELECT d FROM Discount d WHERE d.perUser = :perUser") })
@NamedQuery(name = "Discount.findByPerUser", query = "SELECT d FROM Discount d WHERE d.perUser = :perUser")})
public class Discount implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "discounts_id", nullable = false)
private Integer discountsId;
private Integer id;
@Basic(optional = false)
@Column(name = "percentage", nullable = false)
private BigInteger percentage;
@Column(name = "code", length = 2147483647)
private String code;
@Column(name = "details", length = 2147483647)
private String details;
@Basic(optional = false)
@Column(name = "amount_min", nullable = false)
private int amountMin;
@Basic(optional = false)
@Column(name = "amount_max", nullable = false)
private int amountMax;
@Basic(optional = false)
@Column(name = "active", nullable = false)
private boolean active;
@Basic(optional = false)
@Column(name = "max_num", nullable = false)
private int maxNum;
@Basic(optional = false)
@Column(name = "per_user", nullable = false)
private int perUser;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "discountsId")
private List<DiscountInstance> discountInstanceList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Discount() {
}
public Discount(Integer discountsId) {
this.discountsId = discountsId;
this.id = discountsId;
}
public Discount(Integer discountsId, BigInteger percentage, int amountMin,
int amountMax, boolean active, int maxNum, int perUser) {
this.discountsId = discountsId;
public Discount(Integer discountsId, BigInteger percentage, int amountMin, int amountMax, boolean active, int maxNum, int perUser) {
this.id = discountsId;
this.percentage = percentage;
this.amountMin = amountMin;
this.amountMax = amountMax;
......@@ -77,14 +89,6 @@ public class Discount implements Serializable {
this.perUser = perUser;
}
public Integer getDiscountsId() {
return discountsId;
}
public void setDiscountsId(Integer discountsId) {
this.discountsId = discountsId;
}
public BigInteger getPercentage() {
return percentage;
}
......@@ -153,29 +157,25 @@ public class Discount implements Serializable {
return discountInstanceList;
}
public void setDiscountInstanceList(
List<DiscountInstance> discountInstanceList) {
public void setDiscountInstanceList(List<DiscountInstance> discountInstanceList) {
this.discountInstanceList = discountInstanceList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (discountsId != null ? discountsId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Discount)) {
return false;
}
Discount other = (Discount) object;
if ((this.discountsId == null && other.discountsId != null)
|| (this.discountsId != null && !this.discountsId
.equals(other.discountsId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -183,8 +183,7 @@ public class Discount implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Discount[discountsId=" + discountsId
+ "]";
return "fi.insomnia.bortal.model.Discount[discountsId=" + id + "]";
}
}
......@@ -2,11 +2,9 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -15,6 +13,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -22,14 +21,16 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "discount_instances")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "DiscountInstance.findAll", query = "SELECT d FROM DiscountInstance d"),
@NamedQuery(name = "DiscountInstance.findByDiscountsInstancesId", query = "SELECT d FROM DiscountInstance d WHERE d.discountsInstancesId = :discountsInstancesId") })
public class DiscountInstance implements Serializable {
@NamedQuery(name = "DiscountInstance.findByDiscountsInstancesId", query = "SELECT d FROM DiscountInstance d WHERE d.discountsInstancesId = :discountsInstancesId")})
public class DiscountInstance implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "discounts_instances_id", nullable = false)
private Integer discountsInstancesId;
private Integer id;
@JoinColumn(name = "account_events_id", referencedColumnName = "account_events_id")
@ManyToOne
private AccountEvent accountEventsId;
......@@ -39,20 +40,15 @@ public class DiscountInstance implements Serializable {
@JoinColumn(name = "users_id", referencedColumnName = "users_id", nullable = false)
@ManyToOne(optional = false)
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public DiscountInstance() {
}
public DiscountInstance(Integer discountsInstancesId) {
this.discountsInstancesId = discountsInstancesId;
}
public Integer getDiscountsInstancesId() {
return discountsInstancesId;
}
public void setDiscountsInstancesId(Integer discountsInstancesId) {
this.discountsInstancesId = discountsInstancesId;
this.id = discountsInstancesId;
}
public AccountEvent getAccountEventsId() {
......@@ -82,22 +78,18 @@ public class DiscountInstance implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (discountsInstancesId != null ? discountsInstancesId.hashCode()
: 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DiscountInstance)) {
return false;
}
DiscountInstance other = (DiscountInstance) object;
if ((this.discountsInstancesId == null && other.discountsInstancesId != null)
|| (this.discountsInstancesId != null && !this.discountsInstancesId
.equals(other.discountsInstancesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -105,8 +97,34 @@ public class DiscountInstance implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.DiscountInstance[discountsInstancesId="
+ discountsInstancesId + "]";
return "fi.insomnia.bortal.model.DiscountInstance[discountsInstancesId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,13 +2,12 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -21,6 +20,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -28,24 +28,27 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "events")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Event.findAll", query = "SELECT e FROM Event e"),
@NamedQuery(name = "Event.findByEventsId", query = "SELECT e FROM Event e WHERE e.eventsId = :eventsId"),
@NamedQuery(name = "Event.findByStartTime", query = "SELECT e FROM Event e WHERE e.startTime = :startTime"),
@NamedQuery(name = "Event.findByEndTime", query = "SELECT e FROM Event e WHERE e.endTime = :endTime"),
@NamedQuery(name = "Event.findByName", query = "SELECT e FROM Event e WHERE e.name = :name"),
@NamedQuery(name = "Event.findByReferer", query = "SELECT e FROM Event e WHERE e.referer = :referer") })
public class Event implements Serializable {
@NamedQuery(name = "Event.findByReferer", query = "SELECT e FROM Event e WHERE e.referer = :referer")})
public class Event implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "events_id", nullable = false)
private Integer eventsId;
private Integer id;
@Column(name = "start_time")
@Temporal(TemporalType.TIMESTAMP)
private Date startTime;
@Column(name = "end_time")
@Temporal(TemporalType.TIMESTAMP)
private Date endTime;
@Basic(optional = false)
@Column(name = "name", nullable = false, length = 2147483647)
private String name;
@Column(name = "referer", length = 2147483647)
......@@ -67,27 +70,22 @@ public class Event implements Serializable {
private List<EventMap> eventMapList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "eventsId")
private List<Role> roleList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Event() {
}
public Event(Integer eventsId) {
this.eventsId = eventsId;
this.id = eventsId;
}
public Event(Integer eventsId, String name) {
this.eventsId = eventsId;
this.id = eventsId;
this.name = name;
}
public Integer getEventsId() {
return eventsId;
}
public void setEventsId(Integer eventsId) {
this.eventsId = eventsId;
}
public Date getStartTime() {
return startTime;
}
......@@ -179,21 +177,18 @@ public class Event implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (eventsId != null ? eventsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Event)) {
return false;
}
Event other = (Event) object;
if ((this.eventsId == null && other.eventsId != null)
|| (this.eventsId != null && !this.eventsId
.equals(other.eventsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -201,7 +196,34 @@ public class Event implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Event[eventsId=" + eventsId + "]";
return "fi.insomnia.bortal.model.Event[eventsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -19,6 +18,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -26,15 +26,17 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "maps")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "EventMap.findAll", query = "SELECT e FROM EventMap e"),
@NamedQuery(name = "EventMap.findByMapsId", query = "SELECT e FROM EventMap e WHERE e.mapsId = :mapsId"),
@NamedQuery(name = "EventMap.findByMapName", query = "SELECT e FROM EventMap e WHERE e.mapName = :mapName") })
public class EventMap implements Serializable {
@NamedQuery(name = "EventMap.findByMapName", query = "SELECT e FROM EventMap e WHERE e.mapName = :mapName")})
public class EventMap implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "maps_id", nullable = false)
private Integer mapsId;
private Integer id;
@Lob
@Column(name = "map_data")
private byte[] mapData;
......@@ -45,20 +47,15 @@ public class EventMap implements Serializable {
@JoinColumn(name = "events_id", referencedColumnName = "events_id", nullable = false)
@ManyToOne(optional = false)
private Event eventsId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public EventMap() {
}
public EventMap(Integer mapsId) {
this.mapsId = mapsId;
}
public Integer getMapsId() {
return mapsId;
}
public void setMapsId(Integer mapsId) {
this.mapsId = mapsId;
this.id = mapsId;
}
public byte[] getMapData() {
......@@ -96,20 +93,18 @@ public class EventMap implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (mapsId != null ? mapsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof EventMap)) {
return false;
}
EventMap other = (EventMap) object;
if ((this.mapsId == null && other.mapsId != null)
|| (this.mapsId != null && !this.mapsId.equals(other.mapsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -117,7 +112,34 @@ public class EventMap implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.EventMap[mapsId=" + mapsId + "]";
return "fi.insomnia.bortal.model.EventMap[mapsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -16,6 +15,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -23,18 +23,20 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "event_settings")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "EventSettings.findAll", query = "SELECT e FROM EventSettings e"),
@NamedQuery(name = "EventSettings.findByEventSettingsId", query = "SELECT e FROM EventSettings e WHERE e.eventSettingsId = :eventSettingsId"),
@NamedQuery(name = "EventSettings.findByResourceBundle", query = "SELECT e FROM EventSettings e WHERE e.resourceBundle = :resourceBundle"),
@NamedQuery(name = "EventSettings.findByStyleSheet", query = "SELECT e FROM EventSettings e WHERE e.styleSheet = :styleSheet"),
@NamedQuery(name = "EventSettings.findByNameGeneralForm", query = "SELECT e FROM EventSettings e WHERE e.nameGeneralForm = :nameGeneralForm"),
@NamedQuery(name = "EventSettings.findByNamePossissiveForm", query = "SELECT e FROM EventSettings e WHERE e.namePossissiveForm = :namePossissiveForm") })
public class EventSettings implements Serializable {
@NamedQuery(name = "EventSettings.findByNamePossissiveForm", query = "SELECT e FROM EventSettings e WHERE e.namePossissiveForm = :namePossissiveForm")})
public class EventSettings implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "event_settings_id", nullable = false)
private Integer eventSettingsId;
private Integer id;
@Column(name = "resource_bundle", length = 2147483647)
private String resourceBundle;
@Column(name = "style_sheet", length = 2147483647)
......@@ -45,20 +47,15 @@ public class EventSettings implements Serializable {
private String namePossissiveForm;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "eventSettingsId")
private List<Event> eventList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public EventSettings() {
}
public EventSettings(Integer eventSettingsId) {
this.eventSettingsId = eventSettingsId;
}
public Integer getEventSettingsId() {
return eventSettingsId;
}
public void setEventSettingsId(Integer eventSettingsId) {
this.eventSettingsId = eventSettingsId;
this.id = eventSettingsId;
}
public String getResourceBundle() {
......@@ -104,21 +101,18 @@ public class EventSettings implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (eventSettingsId != null ? eventSettingsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof EventSettings)) {
return false;
}
EventSettings other = (EventSettings) object;
if ((this.eventSettingsId == null && other.eventSettingsId != null)
|| (this.eventSettingsId != null && !this.eventSettingsId
.equals(other.eventSettingsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -126,8 +120,34 @@ public class EventSettings implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.EventSettings[eventSettingsId="
+ eventSettingsId + "]";
return "fi.insomnia.bortal.model.EventSettings[eventSettingsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -17,47 +16,47 @@ import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "event_status", uniqueConstraints = { @UniqueConstraint(columnNames = { "status_name" }) })
@NamedQueries( {
@Table(name = "event_status", uniqueConstraints = {
@UniqueConstraint(columnNames = {"status_name"})})
@NamedQueries({
@NamedQuery(name = "EventStatus.findAll", query = "SELECT e FROM EventStatus e"),
@NamedQuery(name = "EventStatus.findByEventStatusId", query = "SELECT e FROM EventStatus e WHERE e.eventStatusId = :eventStatusId"),
@NamedQuery(name = "EventStatus.findByStatusName", query = "SELECT e FROM EventStatus e WHERE e.statusName = :statusName") })
public class EventStatus implements Serializable {
@NamedQuery(name = "EventStatus.findByStatusName", query = "SELECT e FROM EventStatus e WHERE e.statusName = :statusName")})
public class EventStatus implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "event_status_id", nullable = false)
private Integer eventStatusId;
private Integer id;
@Basic(optional = false)
@Column(name = "status_name", nullable = false, length = 2147483647)
private String statusName;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "eventStatusId")
private List<Event> eventList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public EventStatus() {
}
public EventStatus(Integer eventStatusId) {
this.eventStatusId = eventStatusId;
this.id = eventStatusId;
}
public EventStatus(Integer eventStatusId, String statusName) {
this.eventStatusId = eventStatusId;
this.id = eventStatusId;
this.statusName = statusName;
}
public Integer getEventStatusId() {
return eventStatusId;
}
public void setEventStatusId(Integer eventStatusId) {
this.eventStatusId = eventStatusId;
}
public String getStatusName() {
return statusName;
}
......@@ -77,21 +76,18 @@ public class EventStatus implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (eventStatusId != null ? eventStatusId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof EventStatus)) {
return false;
}
EventStatus other = (EventStatus) object;
if ((this.eventStatusId == null && other.eventStatusId != null)
|| (this.eventStatusId != null && !this.eventStatusId
.equals(other.eventStatusId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -99,8 +95,34 @@ public class EventStatus implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.EventStatus[eventStatusId="
+ eventStatusId + "]";
return "fi.insomnia.bortal.model.EventStatus[eventStatusId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,13 +2,12 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -18,6 +17,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -25,18 +25,21 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "food_waves")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "FoodWave.findAll", query = "SELECT f FROM FoodWave f"),
@NamedQuery(name = "FoodWave.findByFoodWavesId", query = "SELECT f FROM FoodWave f WHERE f.foodWavesId = :foodWavesId"),
@NamedQuery(name = "FoodWave.findByWaveName", query = "SELECT f FROM FoodWave f WHERE f.waveName = :waveName"),
@NamedQuery(name = "FoodWave.findByWaveDescription", query = "SELECT f FROM FoodWave f WHERE f.waveDescription = :waveDescription"),
@NamedQuery(name = "FoodWave.findByWaveTime", query = "SELECT f FROM FoodWave f WHERE f.waveTime = :waveTime"),
@NamedQuery(name = "FoodWave.findByWaveClosed", query = "SELECT f FROM FoodWave f WHERE f.waveClosed = :waveClosed") })
public class FoodWave implements Serializable {
@NamedQuery(name = "FoodWave.findByWaveClosed", query = "SELECT f FROM FoodWave f WHERE f.waveClosed = :waveClosed")})
public class FoodWave implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "food_waves_id", nullable = false)
private Integer foodWavesId;
private Integer id;
@Basic(optional = false)
@Column(name = "wave_name", nullable = false, length = 2147483647)
private String waveName;
@Column(name = "wave_description", length = 2147483647)
......@@ -44,32 +47,28 @@ public class FoodWave implements Serializable {
@Column(name = "wave_time")
@Temporal(TemporalType.TIMESTAMP)
private Date waveTime;
@Basic(optional = false)
@Column(name = "wave_closed", nullable = false)
private boolean waveClosed;
@OneToMany(mappedBy = "foodWavesId")
private List<AccountEvent> accountEventList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public FoodWave() {
}
public FoodWave(Integer foodWavesId) {
this.foodWavesId = foodWavesId;
this.id = foodWavesId;
}
public FoodWave(Integer foodWavesId, String waveName, boolean waveClosed) {
this.foodWavesId = foodWavesId;
this.id = foodWavesId;
this.waveName = waveName;
this.waveClosed = waveClosed;
}
public Integer getFoodWavesId() {
return foodWavesId;
}
public void setFoodWavesId(Integer foodWavesId) {
this.foodWavesId = foodWavesId;
}
public String getWaveName() {
return waveName;
}
......@@ -113,21 +112,18 @@ public class FoodWave implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (foodWavesId != null ? foodWavesId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof FoodWave)) {
return false;
}
FoodWave other = (FoodWave) object;
if ((this.foodWavesId == null && other.foodWavesId != null)
|| (this.foodWavesId != null && !this.foodWavesId
.equals(other.foodWavesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -135,8 +131,34 @@ public class FoodWave implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.FoodWave[foodWavesId=" + foodWavesId
+ "]";
return "fi.insomnia.bortal.model.FoodWave[foodWavesId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -15,6 +14,7 @@ import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -22,44 +22,41 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "food_wave_templates")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "FoodWaveTemplate.findAll", query = "SELECT f FROM FoodWaveTemplate f"),
@NamedQuery(name = "FoodWaveTemplate.findByFoodWaveTemplatesId", query = "SELECT f FROM FoodWaveTemplate f WHERE f.foodWaveTemplatesId = :foodWaveTemplatesId"),
@NamedQuery(name = "FoodWaveTemplate.findByTemplateName", query = "SELECT f FROM FoodWaveTemplate f WHERE f.templateName = :templateName"),
@NamedQuery(name = "FoodWaveTemplate.findByTemplateDescription", query = "SELECT f FROM FoodWaveTemplate f WHERE f.templateDescription = :templateDescription") })
public class FoodWaveTemplate implements Serializable {
@NamedQuery(name = "FoodWaveTemplate.findByTemplateDescription", query = "SELECT f FROM FoodWaveTemplate f WHERE f.templateDescription = :templateDescription")})
public class FoodWaveTemplate implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "food_wave_templates_id", nullable = false)
private Integer foodWaveTemplatesId;
private Integer id;
@Basic(optional = false)
@Column(name = "template_name", nullable = false, length = 2147483647)
private String templateName;
@Column(name = "template_description", length = 2147483647)
private String templateDescription;
@ManyToMany(mappedBy = "foodWaveTemplate")
private List<Product> products;
@Version
@Column(nullable = false)
private int jpaVersionField;
public FoodWaveTemplate() {
}
public FoodWaveTemplate(Integer foodWaveTemplatesId) {
this.foodWaveTemplatesId = foodWaveTemplatesId;
this.id = foodWaveTemplatesId;
}
public FoodWaveTemplate(Integer foodWaveTemplatesId, String templateName) {
this.foodWaveTemplatesId = foodWaveTemplatesId;
this.id = foodWaveTemplatesId;
this.templateName = templateName;
}
public Integer getFoodWaveTemplatesId() {
return foodWaveTemplatesId;
}
public void setFoodWaveTemplatesId(Integer foodWaveTemplatesId) {
this.foodWaveTemplatesId = foodWaveTemplatesId;
}
public String getTemplateName() {
return templateName;
}
......@@ -79,22 +76,18 @@ public class FoodWaveTemplate implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (foodWaveTemplatesId != null ? foodWaveTemplatesId.hashCode()
: 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof FoodWaveTemplate)) {
return false;
}
FoodWaveTemplate other = (FoodWaveTemplate) object;
if ((this.foodWaveTemplatesId == null && other.foodWaveTemplatesId != null)
|| (this.foodWaveTemplatesId != null && !this.foodWaveTemplatesId
.equals(other.foodWaveTemplatesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -102,8 +95,7 @@ public class FoodWaveTemplate implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.FoodWaveTemplate[foodWaveTemplatesId="
+ foodWaveTemplatesId + "]";
return "fi.insomnia.bortal.model.FoodWaveTemplate[foodWaveTemplatesId=" + getId() + "]";
}
/**
......@@ -114,11 +106,37 @@ public class FoodWaveTemplate implements Serializable {
}
/**
* @param products
* the products to set
* @param products the products to set
*/
public void setProducts(List<Product> products) {
this.products = products;
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -19,25 +18,28 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "group_memberships", uniqueConstraints = { @UniqueConstraint(columnNames = {
"users_id", "groups_id" }) })
@NamedQueries( {
@Table(name = "group_memberships", uniqueConstraints = {
@UniqueConstraint(columnNames = {"users_id", "groups_id"})})
@NamedQueries({
@NamedQuery(name = "GroupMembership.findAll", query = "SELECT g FROM GroupMembership g"),
@NamedQuery(name = "GroupMembership.findByGroupMembershipsId", query = "SELECT g FROM GroupMembership g WHERE g.groupMembershipsId = :groupMembershipsId"),
@NamedQuery(name = "GroupMembership.findByInviteAccepted", query = "SELECT g FROM GroupMembership g WHERE g.inviteAccepted = :inviteAccepted"),
@NamedQuery(name = "GroupMembership.findByInviteEmail", query = "SELECT g FROM GroupMembership g WHERE g.inviteEmail = :inviteEmail"),
@NamedQuery(name = "GroupMembership.findByInviteName", query = "SELECT g FROM GroupMembership g WHERE g.inviteName = :inviteName") })
public class GroupMembership implements Serializable {
@NamedQuery(name = "GroupMembership.findByInviteName", query = "SELECT g FROM GroupMembership g WHERE g.inviteName = :inviteName")})
public class GroupMembership implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "group_memberships_id", nullable = false)
private Integer groupMembershipsId;
private Integer id;
@Column(name = "invite_accepted")
@Temporal(TemporalType.TIMESTAMP)
private Date inviteAccepted;
......@@ -54,20 +56,15 @@ public class GroupMembership implements Serializable {
@JoinColumn(name = "users_id", referencedColumnName = "users_id")
@ManyToOne
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public GroupMembership() {
}
public GroupMembership(Integer groupMembershipsId) {
this.groupMembershipsId = groupMembershipsId;
}
public Integer getGroupMembershipsId() {
return groupMembershipsId;
}
public void setGroupMembershipsId(Integer groupMembershipsId) {
this.groupMembershipsId = groupMembershipsId;
this.id = groupMembershipsId;
}
public Date getInviteAccepted() {
......@@ -121,21 +118,18 @@ public class GroupMembership implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (groupMembershipsId != null ? groupMembershipsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof GroupMembership)) {
return false;
}
GroupMembership other = (GroupMembership) object;
if ((this.groupMembershipsId == null && other.groupMembershipsId != null)
|| (this.groupMembershipsId != null && !this.groupMembershipsId
.equals(other.groupMembershipsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -143,8 +137,34 @@ public class GroupMembership implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.GroupMembership[groupMembershipsId="
+ groupMembershipsId + "]";
return "fi.insomnia.bortal.model.GroupMembership[groupMembershipsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,10 +2,8 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
......@@ -16,6 +14,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -23,42 +22,40 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "locations")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Location.findAll", query = "SELECT l FROM Location l"),
@NamedQuery(name = "Location.findByLocationsId", query = "SELECT l FROM Location l WHERE l.locationsId = :locationsId"),
@NamedQuery(name = "Location.findByLocationName", query = "SELECT l FROM Location l WHERE l.locationName = :locationName") })
public class Location implements Serializable {
@NamedQuery(name = "Location.findByLocationName", query = "SELECT l FROM Location l WHERE l.locationName = :locationName")})
public class Location implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "locations_id", nullable = false)
private Integer locationsId;
private Integer id;
@Basic(optional = false)
@Column(name = "location_name", nullable = false, length = 2147483647)
private String locationName;
@OneToMany(mappedBy = "locationsId")
private List<Reader> readerList;
@OneToMany(mappedBy = "currentLocation")
private List<PrintedCard> printedCardList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Location() {
}
public Location(Integer locationsId) {
this.locationsId = locationsId;
this.id = locationsId;
}
public Location(Integer locationsId, String locationName) {
this.locationsId = locationsId;
this.id = locationsId;
this.locationName = locationName;
}
public Integer getLocationsId() {
return locationsId;
}
public void setLocationsId(Integer locationsId) {
this.locationsId = locationsId;
}
public String getLocationName() {
return locationName;
}
......@@ -86,21 +83,18 @@ public class Location implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (locationsId != null ? locationsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Location)) {
return false;
}
Location other = (Location) object;
if ((this.locationsId == null && other.locationsId != null)
|| (this.locationsId != null && !this.locationsId
.equals(other.locationsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -108,8 +102,34 @@ public class Location implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Location[locationsId=" + locationsId
+ "]";
return "fi.insomnia.bortal.model.Location[locationsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -18,6 +17,7 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -25,16 +25,19 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "event_log")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "LogEntry.findAll", query = "SELECT l FROM LogEntry l"),
@NamedQuery(name = "LogEntry.findByEventLogId", query = "SELECT l FROM LogEntry l WHERE l.eventLogId = :eventLogId"),
@NamedQuery(name = "LogEntry.findByEventTime", query = "SELECT l FROM LogEntry l WHERE l.eventTime = :eventTime"),
@NamedQuery(name = "LogEntry.findByEventDescription", query = "SELECT l FROM LogEntry l WHERE l.eventDescription = :eventDescription") })
public class LogEntry implements Serializable {
@NamedQuery(name = "LogEntry.findByEventDescription", query = "SELECT l FROM LogEntry l WHERE l.eventDescription = :eventDescription")})
public class LogEntry implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "event_log_id", nullable = false)
private Integer eventLogId;
private Integer id;
@Basic(optional = false)
@Column(name = "event_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date eventTime;
......@@ -46,27 +49,22 @@ public class LogEntry implements Serializable {
@JoinColumn(name = "users_id", referencedColumnName = "users_id")
@ManyToOne
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public LogEntry() {
}
public LogEntry(Integer eventLogId) {
this.eventLogId = eventLogId;
this.id = eventLogId;
}
public LogEntry(Integer eventLogId, Date eventTime) {
this.eventLogId = eventLogId;
this.id = eventLogId;
this.eventTime = eventTime;
}
public Integer getEventLogId() {
return eventLogId;
}
public void setEventLogId(Integer eventLogId) {
this.eventLogId = eventLogId;
}
public Date getEventTime() {
return eventTime;
}
......@@ -102,21 +100,18 @@ public class LogEntry implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (eventLogId != null ? eventLogId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof LogEntry)) {
return false;
}
LogEntry other = (LogEntry) object;
if ((this.eventLogId == null && other.eventLogId != null)
|| (this.eventLogId != null && !this.eventLogId
.equals(other.eventLogId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -124,8 +119,34 @@ public class LogEntry implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.LogEntry[eventLogId=" + eventLogId
+ "]";
return "fi.insomnia.bortal.model.LogEntry[eventLogId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -16,6 +15,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -23,40 +23,38 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "event_log_types")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "LogEntryType.findAll", query = "SELECT l FROM LogEntryType l"),
@NamedQuery(name = "LogEntryType.findByEventLogTypesId", query = "SELECT l FROM LogEntryType l WHERE l.eventLogTypesId = :eventLogTypesId"),
@NamedQuery(name = "LogEntryType.findByEventTypeDescription", query = "SELECT l FROM LogEntryType l WHERE l.eventTypeDescription = :eventTypeDescription") })
public class LogEntryType implements Serializable {
@NamedQuery(name = "LogEntryType.findByEventTypeDescription", query = "SELECT l FROM LogEntryType l WHERE l.eventTypeDescription = :eventTypeDescription")})
public class LogEntryType implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "event_log_types_id", nullable = false)
private Integer eventLogTypesId;
private Integer id;
@Basic(optional = false)
@Column(name = "event_type_description", nullable = false, length = 2147483647)
private String eventTypeDescription;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "eventLogTypesId")
private List<LogEntry> logEntryList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public LogEntryType() {
}
public LogEntryType(Integer eventLogTypesId) {
this.eventLogTypesId = eventLogTypesId;
this.id = eventLogTypesId;
}
public LogEntryType(Integer eventLogTypesId, String eventTypeDescription) {
this.eventLogTypesId = eventLogTypesId;
this.id = eventLogTypesId;
this.eventTypeDescription = eventTypeDescription;
}
public Integer getEventLogTypesId() {
return eventLogTypesId;
}
public void setEventLogTypesId(Integer eventLogTypesId) {
this.eventLogTypesId = eventLogTypesId;
}
public String getEventTypeDescription() {
return eventTypeDescription;
}
......@@ -76,21 +74,18 @@ public class LogEntryType implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (eventLogTypesId != null ? eventLogTypesId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof LogEntryType)) {
return false;
}
LogEntryType other = (LogEntryType) object;
if ((this.eventLogTypesId == null && other.eventLogTypesId != null)
|| (this.eventLogTypesId != null && !this.eventLogTypesId
.equals(other.eventLogTypesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -98,8 +93,34 @@ public class LogEntryType implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.LogEntryType[eventLogTypesId="
+ eventLogTypesId + "]";
return "fi.insomnia.bortal.model.LogEntryType[eventLogTypesId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
/**
*
* @author tuukka
*/
public interface ModelInterface extends Serializable {
public Integer getId();
public void setId(Integer id);
public int getJpaVersionField();
public void setJpaVersionField(int jpaVersionField);
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -18,6 +17,7 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -25,7 +25,7 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "news")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "News.findAll", query = "SELECT n FROM News n"),
@NamedQuery(name = "News.findByNewsId", query = "SELECT n FROM News n WHERE n.newsId = :newsId"),
@NamedQuery(name = "News.findByTitle", query = "SELECT n FROM News n WHERE n.title = :title"),
......@@ -33,12 +33,15 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "News.findByAbstract1", query = "SELECT n FROM News n WHERE n.abstract1 = :abstract1"),
@NamedQuery(name = "News.findByPublish", query = "SELECT n FROM News n WHERE n.publish = :publish"),
@NamedQuery(name = "News.findByExpire", query = "SELECT n FROM News n WHERE n.expire = :expire"),
@NamedQuery(name = "News.findByPriority", query = "SELECT n FROM News n WHERE n.priority = :priority") })
public class News implements Serializable {
@NamedQuery(name = "News.findByPriority", query = "SELECT n FROM News n WHERE n.priority = :priority")})
public class News implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "news_id", nullable = false)
private Integer newsId;
private Integer id;
@Basic(optional = false)
@Column(name = "title", nullable = false, length = 2147483647)
private String title;
@Column(name = "body", length = 2147483647)
......@@ -51,33 +54,29 @@ public class News implements Serializable {
@Column(name = "expire")
@Temporal(TemporalType.TIMESTAMP)
private Date expire;
@Basic(optional = false)
@Column(name = "priority", nullable = false)
private int priority;
@JoinColumn(name = "news_groups_id", referencedColumnName = "news_groups_id", nullable = false)
@ManyToOne(optional = false)
private NewsGroup newsGroupsId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public News() {
}
public News(Integer newsId) {
this.newsId = newsId;
this.id = newsId;
}
public News(Integer newsId, String title, int priority) {
this.newsId = newsId;
this.id = newsId;
this.title = title;
this.priority = priority;
}
public Integer getNewsId() {
return newsId;
}
public void setNewsId(Integer newsId) {
this.newsId = newsId;
}
public String getTitle() {
return title;
}
......@@ -137,20 +136,18 @@ public class News implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (newsId != null ? newsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof News)) {
return false;
}
News other = (News) object;
if ((this.newsId == null && other.newsId != null)
|| (this.newsId != null && !this.newsId.equals(other.newsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -158,7 +155,34 @@ public class News implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.News[newsId=" + newsId + "]";
return "fi.insomnia.bortal.model.News[newsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -18,6 +17,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -25,21 +25,25 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "news_groups")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "NewsGroup.findAll", query = "SELECT n FROM NewsGroup n"),
@NamedQuery(name = "NewsGroup.findByNewsGroupsId", query = "SELECT n FROM NewsGroup n WHERE n.newsGroupsId = :newsGroupsId"),
@NamedQuery(name = "NewsGroup.findByGroupName", query = "SELECT n FROM NewsGroup n WHERE n.groupName = :groupName"),
@NamedQuery(name = "NewsGroup.findByGroupDescription", query = "SELECT n FROM NewsGroup n WHERE n.groupDescription = :groupDescription"),
@NamedQuery(name = "NewsGroup.findByPriority", query = "SELECT n FROM NewsGroup n WHERE n.priority = :priority") })
public class NewsGroup implements Serializable {
@NamedQuery(name = "NewsGroup.findByPriority", query = "SELECT n FROM NewsGroup n WHERE n.priority = :priority")})
public class NewsGroup implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "news_groups_id", nullable = false)
private Integer newsGroupsId;
private Integer id;
@Basic(optional = false)
@Column(name = "group_name", nullable = false, length = 2147483647)
private String groupName;
@Column(name = "group_description", length = 2147483647)
private String groupDescription;
@Basic(optional = false)
@Column(name = "priority", nullable = false)
private int priority;
@JoinColumn(name = "access_rights_id", referencedColumnName = "access_rights_id", nullable = false)
......@@ -47,28 +51,23 @@ public class NewsGroup implements Serializable {
private AccessRight accessRightsId;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "newsGroupsId")
private List<News> newsList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public NewsGroup() {
}
public NewsGroup(Integer newsGroupsId) {
this.newsGroupsId = newsGroupsId;
this.id = newsGroupsId;
}
public NewsGroup(Integer newsGroupsId, String groupName, int priority) {
this.newsGroupsId = newsGroupsId;
this.id = newsGroupsId;
this.groupName = groupName;
this.priority = priority;
}
public Integer getNewsGroupsId() {
return newsGroupsId;
}
public void setNewsGroupsId(Integer newsGroupsId) {
this.newsGroupsId = newsGroupsId;
}
public String getGroupName() {
return groupName;
}
......@@ -112,21 +111,18 @@ public class NewsGroup implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (newsGroupsId != null ? newsGroupsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof NewsGroup)) {
return false;
}
NewsGroup other = (NewsGroup) object;
if ((this.newsGroupsId == null && other.newsGroupsId != null)
|| (this.newsGroupsId != null && !this.newsGroupsId
.equals(other.newsGroupsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -134,8 +130,34 @@ public class NewsGroup implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.NewsGroup[newsGroupsId="
+ newsGroupsId + "]";
return "fi.insomnia.bortal.model.NewsGroup[newsGroupsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -18,6 +17,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -25,7 +25,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "places")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Place.findAll", query = "SELECT p FROM Place p"),
@NamedQuery(name = "Place.findByPlacesId", query = "SELECT p FROM Place p WHERE p.placesId = :placesId"),
@NamedQuery(name = "Place.findByPlaceDescription", query = "SELECT p FROM Place p WHERE p.placeDescription = :placeDescription"),
......@@ -33,12 +33,14 @@ import javax.persistence.Table;
@NamedQuery(name = "Place.findByMapX", query = "SELECT p FROM Place p WHERE p.mapX = :mapX"),
@NamedQuery(name = "Place.findByMapY", query = "SELECT p FROM Place p WHERE p.mapY = :mapY"),
@NamedQuery(name = "Place.findByPlaceDetails", query = "SELECT p FROM Place p WHERE p.placeDetails = :placeDetails"),
@NamedQuery(name = "Place.findByPlaceCode", query = "SELECT p FROM Place p WHERE p.placeCode = :placeCode") })
public class Place implements Serializable {
@NamedQuery(name = "Place.findByPlaceCode", query = "SELECT p FROM Place p WHERE p.placeCode = :placeCode")})
public class Place implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "places_id", nullable = false)
private Integer placesId;
private Integer id;
@Column(name = "place_description", length = 2147483647)
private String placeDescription;
@Column(name = "place_name", length = 2147483647)
......@@ -65,20 +67,15 @@ public class Place implements Serializable {
@JoinColumn(name = "users_id", referencedColumnName = "users_id")
@ManyToOne
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Place() {
}
public Place(Integer placesId) {
this.placesId = placesId;
}
public Integer getPlacesId() {
return placesId;
}
public void setPlacesId(Integer placesId) {
this.placesId = placesId;
this.id = placesId;
}
public String getPlaceDescription() {
......@@ -172,21 +169,18 @@ public class Place implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (placesId != null ? placesId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Place)) {
return false;
}
Place other = (Place) object;
if ((this.placesId == null && other.placesId != null)
|| (this.placesId != null && !this.placesId
.equals(other.placesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -194,7 +188,34 @@ public class Place implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Place[placesId=" + placesId + "]";
return "fi.insomnia.bortal.model.Place[placesId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,13 +2,12 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -21,6 +20,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -28,7 +28,7 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "groups")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "PlaceGroup.findAll", query = "SELECT p FROM PlaceGroup p"),
@NamedQuery(name = "PlaceGroup.findByGroupsId", query = "SELECT p FROM PlaceGroup p WHERE p.groupsId = :groupsId"),
@NamedQuery(name = "PlaceGroup.findByGroupCreated", query = "SELECT p FROM PlaceGroup p WHERE p.groupCreated = :groupCreated"),
......@@ -36,15 +36,19 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "PlaceGroup.findByGroupCode", query = "SELECT p FROM PlaceGroup p WHERE p.groupCode = :groupCode"),
@NamedQuery(name = "PlaceGroup.findByGroupName", query = "SELECT p FROM PlaceGroup p WHERE p.groupName = :groupName"),
@NamedQuery(name = "PlaceGroup.findByGroupActive", query = "SELECT p FROM PlaceGroup p WHERE p.groupActive = :groupActive"),
@NamedQuery(name = "PlaceGroup.findByGroupDetails", query = "SELECT p FROM PlaceGroup p WHERE p.groupDetails = :groupDetails") })
public class PlaceGroup implements Serializable {
@NamedQuery(name = "PlaceGroup.findByGroupDetails", query = "SELECT p FROM PlaceGroup p WHERE p.groupDetails = :groupDetails")})
public class PlaceGroup implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "groups_id", nullable = false)
private Integer groupsId;
private Integer id;
@Basic(optional = false)
@Column(name = "group_created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date groupCreated;
@Basic(optional = false)
@Column(name = "group_edited", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date groupEdited;
......@@ -52,6 +56,7 @@ public class PlaceGroup implements Serializable {
private String groupCode;
@Column(name = "group_name", length = 2147483647)
private String groupName;
@Basic(optional = false)
@Column(name = "group_active", nullable = false)
private boolean groupActive;
@Column(name = "group_details", length = 2147483647)
......@@ -63,30 +68,24 @@ public class PlaceGroup implements Serializable {
private List<GroupMembership> groupMembershipList;
@OneToMany(mappedBy = "groupsId")
private List<Place> placeList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public PlaceGroup() {
}
public PlaceGroup(Integer groupsId) {
this.groupsId = groupsId;
this.id = groupsId;
}
public PlaceGroup(Integer groupsId, Date groupCreated, Date groupEdited,
boolean groupActive) {
this.groupsId = groupsId;
public PlaceGroup(Integer groupsId, Date groupCreated, Date groupEdited, boolean groupActive) {
this.id = groupsId;
this.groupCreated = groupCreated;
this.groupEdited = groupEdited;
this.groupActive = groupActive;
}
public Integer getGroupsId() {
return groupsId;
}
public void setGroupsId(Integer groupsId) {
this.groupsId = groupsId;
}
public Date getGroupCreated() {
return groupCreated;
}
......@@ -162,21 +161,18 @@ public class PlaceGroup implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (groupsId != null ? groupsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof PlaceGroup)) {
return false;
}
PlaceGroup other = (PlaceGroup) object;
if ((this.groupsId == null && other.groupsId != null)
|| (this.groupsId != null && !this.groupsId
.equals(other.groupsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -184,7 +180,34 @@ public class PlaceGroup implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.PlaceGroup[groupsId=" + groupsId + "]";
return "fi.insomnia.bortal.model.PlaceGroup[groupsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -9,6 +9,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -28,26 +29,30 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "printed_cards")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "PrintedCard.findAll", query = "SELECT p FROM PrintedCard p"),
@NamedQuery(name = "PrintedCard.findByPrintedCardsId", query = "SELECT p FROM PrintedCard p WHERE p.printedCardsId = :printedCardsId"),
@NamedQuery(name = "PrintedCard.findByEventRolesTypesId", query = "SELECT p FROM PrintedCard p WHERE p.eventRolesTypesId = :eventRolesTypesId"),
@NamedQuery(name = "PrintedCard.findByPrintTime", query = "SELECT p FROM PrintedCard p WHERE p.printTime = :printTime"),
@NamedQuery(name = "PrintedCard.findByBarcode", query = "SELECT p FROM PrintedCard p WHERE p.barcode = :barcode"),
@NamedQuery(name = "PrintedCard.findByCardEnabled", query = "SELECT p FROM PrintedCard p WHERE p.cardEnabled = :cardEnabled"),
@NamedQuery(name = "PrintedCard.findByRfidUid", query = "SELECT p FROM PrintedCard p WHERE p.rfidUid = :rfidUid") })
@NamedQuery(name = "PrintedCard.findByRfidUid", query = "SELECT p FROM PrintedCard p WHERE p.rfidUid = :rfidUid")})
public class PrintedCard implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "printed_cards_id", nullable = false)
private Integer printedCardsId;
private Integer id;
@Basic(optional = false)
@Column(name = "event_roles_types_id", nullable = false)
private int eventRolesTypesId;
@Basic(optional = false)
@Column(name = "print_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date printTime;
@Column(name = "barcode", length = 2147483647)
private String barcode;
@Basic(optional = false)
@Column(name = "card_enabled", nullable = false)
private boolean cardEnabled;
@Column(name = "rfid_uid", length = 2147483647)
......@@ -61,29 +66,25 @@ public class PrintedCard implements Serializable {
@ManyToOne(optional = false)
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public PrintedCard() {
}
public PrintedCard(Integer printedCardsId) {
this.printedCardsId = printedCardsId;
this.id = printedCardsId;
}
public PrintedCard(Integer printedCardsId, int eventRolesTypesId,
Date printTime, boolean cardEnabled) {
this.printedCardsId = printedCardsId;
public PrintedCard(Integer printedCardsId, int eventRolesTypesId, Date printTime, boolean cardEnabled) {
this.id = printedCardsId;
this.eventRolesTypesId = eventRolesTypesId;
this.printTime = printTime;
this.cardEnabled = cardEnabled;
}
public Integer getPrintedCardsId() {
return printedCardsId;
}
public void setPrintedCardsId(Integer printedCardsId) {
this.printedCardsId = printedCardsId;
}
public int getEventRolesTypesId() {
return eventRolesTypesId;
}
......@@ -151,21 +152,18 @@ public class PrintedCard implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (printedCardsId != null ? printedCardsId.hashCode() : 0);
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof PrintedCard)) {
return false;
}
PrintedCard other = (PrintedCard) object;
if ((this.printedCardsId == null && other.printedCardsId != null)
|| (this.printedCardsId != null && !this.printedCardsId
.equals(other.printedCardsId))) {
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -173,8 +171,7 @@ public class PrintedCard implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.PrintedCard[printedCardsId="
+ printedCardsId + "]";
return "fi.insomnia.bortal.model.PrintedCard[printedCardsId=" + id + "]";
}
}
......@@ -2,13 +2,13 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -20,6 +20,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -27,22 +28,26 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "products")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Product.findAll", query = "SELECT p FROM Product p"),
@NamedQuery(name = "Product.findByProductsId", query = "SELECT p FROM Product p WHERE p.productsId = :productsId"),
@NamedQuery(name = "Product.findByProductName", query = "SELECT p FROM Product p WHERE p.productName = :productName"),
@NamedQuery(name = "Product.findByPrice", query = "SELECT p FROM Product p WHERE p.price = :price"),
@NamedQuery(name = "Product.findBySort", query = "SELECT p FROM Product p WHERE p.sort = :sort"),
@NamedQuery(name = "Product.findByBarcode", query = "SELECT p FROM Product p WHERE p.barcode = :barcode") })
public class Product implements Serializable {
@NamedQuery(name = "Product.findByBarcode", query = "SELECT p FROM Product p WHERE p.barcode = :barcode")})
public class Product implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "products_id", nullable = false)
private Integer productsId;
private Integer id;
@Column(name = "product_name", length = 2147483647)
private String productName;
@Basic(optional = false)
@Column(name = "price", nullable = false)
private BigInteger price;
@Basic(optional = false)
@Column(name = "sort", nullable = false)
private int sort;
@Column(name = "barcode", length = 2147483647)
......@@ -51,32 +56,28 @@ public class Product implements Serializable {
private List<Place> placeList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "productsId")
private List<AccountEvent> accountEventList;
@JoinTable(name = "food_wave_templates_products", joinColumns = { @JoinColumn(name = "products_id", referencedColumnName = "products_id") }, inverseJoinColumns = { @JoinColumn(name = "food_wave_templates_id", referencedColumnName = "food_wave_templates_id") })
@JoinTable(name = "food_wave_templates_products", joinColumns = {
@JoinColumn(name = "products_id", referencedColumnName = "products_id")}, inverseJoinColumns = {
@JoinColumn(name = "food_wave_templates_id", referencedColumnName = "food_wave_templates_id")})
@ManyToMany
private List<FoodWaveTemplate> foodWaveTemplate;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Product() {
}
public Product(Integer productsId) {
this.productsId = productsId;
this.id = productsId;
}
public Product(Integer productsId, BigInteger price, int sort) {
this.productsId = productsId;
this.id = productsId;
this.price = price;
this.sort = sort;
}
public Integer getProductsId() {
return productsId;
}
public void setProductsId(Integer productsId) {
this.productsId = productsId;
}
public String getProductName() {
return productName;
}
......@@ -128,7 +129,7 @@ public class Product implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (productsId != null ? productsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
......@@ -140,9 +141,8 @@ public class Product implements Serializable {
return false;
}
Product other = (Product) object;
if ((this.productsId == null && other.productsId != null)
|| (this.productsId != null && !this.productsId
.equals(other.productsId))) {
if ((this.getId() == null && other.getId() != null)
|| (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -150,7 +150,7 @@ public class Product implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Product[productsId=" + productsId
return "fi.insomnia.bortal.model.Product[productsId=" + getId()
+ "]";
}
......@@ -169,4 +169,31 @@ public class Product implements Serializable {
this.foodWaveTemplate = foodWaveTemplate;
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -18,6 +17,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -25,16 +25,18 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "readers")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Reader.findAll", query = "SELECT r FROM Reader r"),
@NamedQuery(name = "Reader.findByReadersId", query = "SELECT r FROM Reader r WHERE r.readersId = :readersId"),
@NamedQuery(name = "Reader.findByReaderId", query = "SELECT r FROM Reader r WHERE r.readerId = :readerId"),
@NamedQuery(name = "Reader.findByReaderDescription", query = "SELECT r FROM Reader r WHERE r.readerDescription = :readerDescription") })
public class Reader implements Serializable {
@NamedQuery(name = "Reader.findByReaderDescription", query = "SELECT r FROM Reader r WHERE r.readerDescription = :readerDescription")})
public class Reader implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "readers_id", nullable = false)
private Integer readersId;
private Integer id;
@Column(name = "reader_id", length = 2147483647)
private String readerId;
@Column(name = "reader_description", length = 2147483647)
......@@ -44,20 +46,15 @@ public class Reader implements Serializable {
@JoinColumn(name = "locations_id", referencedColumnName = "locations_id")
@ManyToOne
private Location locationsId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Reader() {
}
public Reader(Integer readersId) {
this.readersId = readersId;
}
public Integer getReadersId() {
return readersId;
}
public void setReadersId(Integer readersId) {
this.readersId = readersId;
this.id = readersId;
}
public String getReaderId() {
......@@ -95,21 +92,18 @@ public class Reader implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (readersId != null ? readersId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Reader)) {
return false;
}
Reader other = (Reader) object;
if ((this.readersId == null && other.readersId != null)
|| (this.readersId != null && !this.readersId
.equals(other.readersId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -117,7 +111,34 @@ public class Reader implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Reader[readersId=" + readersId + "]";
return "fi.insomnia.bortal.model.Reader[readersId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,12 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -18,6 +18,7 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -25,16 +26,19 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "reader_events")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "ReaderEvent.findAll", query = "SELECT r FROM ReaderEvent r"),
@NamedQuery(name = "ReaderEvent.findByReaderEventsId", query = "SELECT r FROM ReaderEvent r WHERE r.readerEventsId = :readerEventsId"),
@NamedQuery(name = "ReaderEvent.findByEventTime", query = "SELECT r FROM ReaderEvent r WHERE r.eventTime = :eventTime"),
@NamedQuery(name = "ReaderEvent.findByValue", query = "SELECT r FROM ReaderEvent r WHERE r.value = :value") })
public class ReaderEvent implements Serializable {
@NamedQuery(name = "ReaderEvent.findByValue", query = "SELECT r FROM ReaderEvent r WHERE r.value = :value")})
public class ReaderEvent implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "reader_events_id", nullable = false)
private Integer readerEventsId;
private Integer id;
@Basic(optional = false)
@Column(name = "event_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date eventTime;
......@@ -46,27 +50,22 @@ public class ReaderEvent implements Serializable {
@JoinColumn(name = "readers_id", referencedColumnName = "readers_id", nullable = false)
@ManyToOne(optional = false)
private Reader readersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public ReaderEvent() {
}
public ReaderEvent(Integer readerEventsId) {
this.readerEventsId = readerEventsId;
this.id = readerEventsId;
}
public ReaderEvent(Integer readerEventsId, Date eventTime) {
this.readerEventsId = readerEventsId;
this.id = readerEventsId;
this.eventTime = eventTime;
}
public Integer getReaderEventsId() {
return readerEventsId;
}
public void setReaderEventsId(Integer readerEventsId) {
this.readerEventsId = readerEventsId;
}
public Date getEventTime() {
return eventTime;
}
......@@ -102,21 +101,18 @@ public class ReaderEvent implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (readerEventsId != null ? readerEventsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ReaderEvent)) {
return false;
}
ReaderEvent other = (ReaderEvent) object;
if ((this.readerEventsId == null && other.readerEventsId != null)
|| (this.readerEventsId != null && !this.readerEventsId
.equals(other.readerEventsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -124,8 +120,34 @@ public class ReaderEvent implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.ReaderEvent[readerEventsId="
+ readerEventsId + "]";
return "fi.insomnia.bortal.model.ReaderEvent[readerEventsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -18,6 +17,7 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -25,15 +25,18 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "roles")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "Role.findAll", query = "SELECT r FROM Role r"),
@NamedQuery(name = "Role.findByRolesId", query = "SELECT r FROM Role r WHERE r.rolesId = :rolesId"),
@NamedQuery(name = "Role.findByRoleName", query = "SELECT r FROM Role r WHERE r.roleName = :roleName") })
public class Role implements Serializable {
@NamedQuery(name = "Role.findByRoleName", query = "SELECT r FROM Role r WHERE r.roleName = :roleName")})
public class Role implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "roles_id", nullable = false)
private Integer rolesId;
private Integer id;
@Basic(optional = false)
@Column(name = "role_name", nullable = false, length = 2147483647)
private String roleName;
@OneToMany(mappedBy = "defaultRole")
......@@ -52,27 +55,22 @@ public class Role implements Serializable {
@JoinColumn(name = "events_id", referencedColumnName = "events_id", nullable = false)
@ManyToOne(optional = false)
private Event eventsId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Role() {
}
public Role(Integer rolesId) {
this.rolesId = rolesId;
this.id = rolesId;
}
public Role(Integer rolesId, String roleName) {
this.rolesId = rolesId;
this.id = rolesId;
this.roleName = roleName;
}
public Integer getRolesId() {
return rolesId;
}
public void setRolesId(Integer rolesId) {
this.rolesId = rolesId;
}
public String getRoleName() {
return roleName;
}
......@@ -109,8 +107,7 @@ public class Role implements Serializable {
return roleInheritanceList1;
}
public void setRoleInheritanceList1(
List<RoleInheritance> roleInheritanceList1) {
public void setRoleInheritanceList1(List<RoleInheritance> roleInheritanceList1) {
this.roleInheritanceList1 = roleInheritanceList1;
}
......@@ -141,20 +138,18 @@ public class Role implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (rolesId != null ? rolesId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Role)) {
return false;
}
Role other = (Role) object;
if ((this.rolesId == null && other.rolesId != null)
|| (this.rolesId != null && !this.rolesId.equals(other.rolesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -162,7 +157,34 @@ public class Role implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Role[rolesId=" + rolesId + "]";
return "fi.insomnia.bortal.model.Role[rolesId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,7 +2,6 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
......@@ -17,42 +16,40 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "role_inheritance", uniqueConstraints = { @UniqueConstraint(columnNames = {
"roles_id", "inherits" }) })
@NamedQueries( {
@Table(name = "role_inheritance", uniqueConstraints = {
@UniqueConstraint(columnNames = {"roles_id", "inherits"})})
@NamedQueries({
@NamedQuery(name = "RoleInheritance.findAll", query = "SELECT r FROM RoleInheritance r"),
@NamedQuery(name = "RoleInheritance.findByRoleInheritanceId", query = "SELECT r FROM RoleInheritance r WHERE r.roleInheritanceId = :roleInheritanceId") })
public class RoleInheritance implements Serializable {
@NamedQuery(name = "RoleInheritance.findByRoleInheritanceId", query = "SELECT r FROM RoleInheritance r WHERE r.roleInheritanceId = :roleInheritanceId")})
public class RoleInheritance implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "role_inheritance_id", nullable = false)
private Integer roleInheritanceId;
private Integer id;
@JoinColumn(name = "roles_id", referencedColumnName = "roles_id", nullable = false)
@ManyToOne(optional = false)
private Role rolesId;
@JoinColumn(name = "inherits", referencedColumnName = "roles_id", nullable = false)
@ManyToOne(optional = false)
private Role inherits;
@Version
@Column(nullable = false)
private int jpaVersionField;
public RoleInheritance() {
}
public RoleInheritance(Integer roleInheritanceId) {
this.roleInheritanceId = roleInheritanceId;
}
public Integer getRoleInheritanceId() {
return roleInheritanceId;
}
public void setRoleInheritanceId(Integer roleInheritanceId) {
this.roleInheritanceId = roleInheritanceId;
this.id = roleInheritanceId;
}
public Role getRolesId() {
......@@ -74,21 +71,18 @@ public class RoleInheritance implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (roleInheritanceId != null ? roleInheritanceId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof RoleInheritance)) {
return false;
}
RoleInheritance other = (RoleInheritance) object;
if ((this.roleInheritanceId == null && other.roleInheritanceId != null)
|| (this.roleInheritanceId != null && !this.roleInheritanceId
.equals(other.roleInheritanceId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -96,8 +90,34 @@ public class RoleInheritance implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.RoleInheritance[roleInheritanceId="
+ roleInheritanceId + "]";
return "fi.insomnia.bortal.model.RoleInheritance[roleInheritanceId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,7 +2,6 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
......@@ -17,42 +16,40 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
/**
*
* @author jkj
*/
@Entity
@Table(name = "role_memberships", uniqueConstraints = { @UniqueConstraint(columnNames = {
"roles_id", "users_id" }) })
@NamedQueries( {
@Table(name = "role_memberships", uniqueConstraints = {
@UniqueConstraint(columnNames = {"roles_id", "users_id"})})
@NamedQueries({
@NamedQuery(name = "RoleMembership.findAll", query = "SELECT r FROM RoleMembership r"),
@NamedQuery(name = "RoleMembership.findByRoleMembershipsId", query = "SELECT r FROM RoleMembership r WHERE r.roleMembershipsId = :roleMembershipsId") })
public class RoleMembership implements Serializable {
@NamedQuery(name = "RoleMembership.findByRoleMembershipsId", query = "SELECT r FROM RoleMembership r WHERE r.roleMembershipsId = :roleMembershipsId")})
public class RoleMembership implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "role_memberships_id", nullable = false)
private Integer roleMembershipsId;
private Integer id;
@JoinColumn(name = "roles_id", referencedColumnName = "roles_id", nullable = false)
@ManyToOne(optional = false)
private Role rolesId;
@JoinColumn(name = "users_id", referencedColumnName = "users_id", nullable = false)
@ManyToOne(optional = false)
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public RoleMembership() {
}
public RoleMembership(Integer roleMembershipsId) {
this.roleMembershipsId = roleMembershipsId;
}
public Integer getRoleMembershipsId() {
return roleMembershipsId;
}
public void setRoleMembershipsId(Integer roleMembershipsId) {
this.roleMembershipsId = roleMembershipsId;
this.id = roleMembershipsId;
}
public Role getRolesId() {
......@@ -74,21 +71,18 @@ public class RoleMembership implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (roleMembershipsId != null ? roleMembershipsId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof RoleMembership)) {
return false;
}
RoleMembership other = (RoleMembership) object;
if ((this.roleMembershipsId == null && other.roleMembershipsId != null)
|| (this.roleMembershipsId != null && !this.roleMembershipsId
.equals(other.roleMembershipsId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -96,8 +90,34 @@ public class RoleMembership implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.RoleMembership[roleMembershipsId="
+ roleMembershipsId + "]";
return "fi.insomnia.bortal.model.RoleMembership[roleMembershipsId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,11 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -15,6 +15,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -22,48 +23,48 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "role_rights")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "RoleRight.findAll", query = "SELECT r FROM RoleRight r"),
@NamedQuery(name = "RoleRight.findByRoleRights", query = "SELECT r FROM RoleRight r WHERE r.roleRights = :roleRights"),
@NamedQuery(name = "RoleRight.findByRead", query = "SELECT r FROM RoleRight r WHERE r.read = :read"),
@NamedQuery(name = "RoleRight.findByWrite", query = "SELECT r FROM RoleRight r WHERE r.write = :write") })
public class RoleRight implements Serializable {
@NamedQuery(name = "RoleRight.findByWrite", query = "SELECT r FROM RoleRight r WHERE r.write = :write")})
public class RoleRight implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "role_rights", nullable = false)
private Integer roleRights;
@Basic(optional = false)
@Column(name = "role_rights_id", nullable = false)
private Integer id;
@Basic(optional = false)
@Column(name = "read", nullable = false)
private boolean read;
@Basic(optional = false)
@Column(name = "write", nullable = false)
private boolean write;
//TODO: add execute
@JoinColumn(name = "access_rights_id", referencedColumnName = "access_rights_id")
@ManyToOne
private AccessRight accessRightsId;
@JoinColumn(name = "roles_id", referencedColumnName = "roles_id", nullable = false)
@ManyToOne(optional = false)
private Role rolesId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public RoleRight() {
}
public RoleRight(Integer roleRights) {
this.roleRights = roleRights;
this.id = roleRights;
}
public RoleRight(Integer roleRights, boolean read, boolean write) {
this.roleRights = roleRights;
this.id = roleRights;
this.read = read;
this.write = write;
}
public Integer getRoleRights() {
return roleRights;
}
public void setRoleRights(Integer roleRights) {
this.roleRights = roleRights;
}
public boolean getRead() {
return read;
}
......@@ -99,21 +100,18 @@ public class RoleRight implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (roleRights != null ? roleRights.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof RoleRight)) {
return false;
}
RoleRight other = (RoleRight) object;
if ((this.roleRights == null && other.roleRights != null)
|| (this.roleRights != null && !this.roleRights
.equals(other.roleRights))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -121,8 +119,34 @@ public class RoleRight implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.RoleRight[roleRights=" + roleRights
+ "]";
return "fi.insomnia.bortal.model.RoleRight[roleRights=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,13 +2,13 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -20,6 +20,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
/**
*
......@@ -27,7 +28,7 @@ import javax.persistence.TemporalType;
*/
@Entity
@Table(name = "users")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
@NamedQuery(name = "User.findByUsersId", query = "SELECT u FROM User u WHERE u.usersId = :usersId"),
@NamedQuery(name = "User.findByCreated", query = "SELECT u FROM User u WHERE u.created = :created"),
......@@ -44,21 +45,27 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "User.findByTown", query = "SELECT u FROM User u WHERE u.town = :town"),
@NamedQuery(name = "User.findByPhone", query = "SELECT u FROM User u WHERE u.phone = :phone"),
@NamedQuery(name = "User.findByFemale", query = "SELECT u FROM User u WHERE u.female = :female"),
@NamedQuery(name = "User.findByLogin", query = "SELECT u FROM User u WHERE u.login = :login") })
public class User implements Serializable {
@NamedQuery(name = "User.findByLogin", query = "SELECT u FROM User u WHERE u.login = :login")})
public class User implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "users_id", nullable = false)
private Integer usersId;
private Integer id;
@Basic(optional = false)
@Column(name = "created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@Basic(optional = false)
@Column(name = "active", nullable = false)
private boolean active;
@Column(name = "password", length = 2147483647)
private String password;
@Basic(optional = false)
@Column(name = "lastname", nullable = false, length = 2147483647)
private String lastname;
@Basic(optional = false)
@Column(name = "firstnames", nullable = false, length = 2147483647)
private String firstnames;
@Column(name = "birthday")
......@@ -111,31 +118,25 @@ public class User implements Serializable {
private List<DiscountInstance> discountInstanceList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "usersId")
private List<Bill> billList;
@Version
@Column(nullable = false)
private int jpaVersionField;
public User() {
}
public User(Integer usersId) {
this.usersId = usersId;
this.id = usersId;
}
public User(Integer usersId, Date created, boolean active, String lastname,
String firstnames) {
this.usersId = usersId;
public User(Integer usersId, Date created, boolean active, String lastname, String firstnames) {
this.id = usersId;
this.created = created;
this.active = active;
this.lastname = lastname;
this.firstnames = firstnames;
}
public Integer getUsersId() {
return usersId;
}
public void setUsersId(Integer usersId) {
this.usersId = usersId;
}
public Date getCreated() {
return created;
}
......@@ -300,8 +301,7 @@ public class User implements Serializable {
return compoEntryParticipantList;
}
public void setCompoEntryParticipantList(
List<CompoEntryParticipant> compoEntryParticipantList) {
public void setCompoEntryParticipantList(List<CompoEntryParticipant> compoEntryParticipantList) {
this.compoEntryParticipantList = compoEntryParticipantList;
}
......@@ -357,8 +357,7 @@ public class User implements Serializable {
return discountInstanceList;
}
public void setDiscountInstanceList(
List<DiscountInstance> discountInstanceList) {
public void setDiscountInstanceList(List<DiscountInstance> discountInstanceList) {
this.discountInstanceList = discountInstanceList;
}
......@@ -373,20 +372,18 @@ public class User implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (usersId != null ? usersId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof User)) {
return false;
}
User other = (User) object;
if ((this.usersId == null && other.usersId != null)
|| (this.usersId != null && !this.usersId.equals(other.usersId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -394,7 +391,34 @@ public class User implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.User[usersId=" + usersId + "]";
return "fi.insomnia.bortal.model.User[usersId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,11 +2,11 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -16,6 +16,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;
/**
*
......@@ -23,22 +24,24 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "user_images")
@NamedQueries( {
@NamedQueries({
@NamedQuery(name = "UserImage.findAll", query = "SELECT u FROM UserImage u"),
@NamedQuery(name = "UserImage.findByUserImagesId", query = "SELECT u FROM UserImage u WHERE u.userImagesId = :userImagesId"),
@NamedQuery(name = "UserImage.findByName", query = "SELECT u FROM UserImage u WHERE u.name = :name"),
@NamedQuery(name = "UserImage.findByDescription", query = "SELECT u FROM UserImage u WHERE u.description = :description"),
@NamedQuery(name = "UserImage.findByMimeType", query = "SELECT u FROM UserImage u WHERE u.mimeType = :mimeType") })
public class UserImage implements Serializable {
@NamedQuery(name = "UserImage.findByMimeType", query = "SELECT u FROM UserImage u WHERE u.mimeType = :mimeType")})
public class UserImage implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "user_images_id", nullable = false)
private Integer userImagesId;
@Column(name = "name")
private Integer id;
@Column(name = "name", length = 2147483647)
private String name;
@Column(name = "description")
@Column(name = "description", length = 2147483647)
private String description;
@Column(name = "mime_type")
@Column(name = "mime_type", length = 2147483647)
private String mimeType;
@Lob
@Column(name = "image_data")
......@@ -46,20 +49,15 @@ public class UserImage implements Serializable {
@JoinColumn(name = "users_id", referencedColumnName = "users_id")
@ManyToOne
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public UserImage() {
}
public UserImage(Integer userImagesId) {
this.userImagesId = userImagesId;
}
public Integer getUserImagesId() {
return userImagesId;
}
public void setUserImagesId(Integer userImagesId) {
this.userImagesId = userImagesId;
this.id = userImagesId;
}
public String getName() {
......@@ -105,21 +103,18 @@ public class UserImage implements Serializable {
@Override
public int hashCode() {
int hash = 0;
hash += (userImagesId != null ? userImagesId.hashCode() : 0);
hash += (getId() != null ? getId().hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
// not set
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof UserImage)) {
return false;
}
UserImage other = (UserImage) object;
if ((this.userImagesId == null && other.userImagesId != null)
|| (this.userImagesId != null && !this.userImagesId
.equals(other.userImagesId))) {
if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
return false;
}
return true;
......@@ -127,8 +122,34 @@ public class UserImage implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.UserImage[userImagesId="
+ userImagesId + "]";
return "fi.insomnia.bortal.model.UserImage[userImagesId=" + getId() + "]";
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
......@@ -2,12 +2,12 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
......@@ -19,25 +19,30 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
/**
* A vote for a compo entry
*/
@Entity
@Table(name = "votes", uniqueConstraints = { @UniqueConstraint(columnNames = {
"entries_id", "users_id" }) })
@NamedQueries( {
@Table(name = "votes", uniqueConstraints = {
@UniqueConstraint(columnNames = {
"entries_id", "users_id"})})
@NamedQueries({
@NamedQuery(name = "Vote.findAll", query = "SELECT v FROM Vote v"),
@NamedQuery(name = "Vote.findById", query = "SELECT v FROM Vote v WHERE v.id = :id"),
@NamedQuery(name = "Vote.findByVotesId", query = "SELECT v FROM Vote v WHERE v.votesId = :votesId"),
@NamedQuery(name = "Vote.findByScore", query = "SELECT v FROM Vote v WHERE v.score = :score"),
@NamedQuery(name = "Vote.findByVoteTime", query = "SELECT v FROM Vote v WHERE v.voteTime = :voteTime") })
public class Vote implements Serializable {
@NamedQuery(name = "Vote.findByVoteTime", query = "SELECT v FROM Vote v WHERE v.voteTime = :voteTime")})
public class Vote implements ModelInterface {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "votes_id", nullable = false)
private Integer id;
@Column(name = "score")
private Integer score;
@Basic(optional = false)
@Column(name = "vote_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date voteTime;
......@@ -47,6 +52,9 @@ public class Vote implements Serializable {
@JoinColumn(name = "users_id", referencedColumnName = "users_id", nullable = false)
@ManyToOne(optional = false)
private User usersId;
@Version
@Column(nullable = false)
private int jpaVersionField;
public Vote() {
}
......@@ -60,11 +68,11 @@ public class Vote implements Serializable {
this.voteTime = voteTime;
}
public Integer getVotesId() {
public Integer getId() {
return id;
}
public void setVotesId(Integer votesId) {
public void setId(Integer votesId) {
this.id = votesId;
}
......@@ -124,7 +132,20 @@ public class Vote implements Serializable {
@Override
public String toString() {
return "fi.insomnia.bortal.model.Vote[id=" + id + "]";
return "fi.insomnia.bortal.model.Vote[votesId=" + id + "]";
}
/**
* @return the jpaVersionField
*/
public int getJpaVersionField() {
return jpaVersionField;
}
/**
* @param jpaVersionField the jpaVersionField to set
*/
public void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!