Skip to content
Snippets Groups Projects
Commit 8a4478a2 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Added license notification headers for all remaining files

parent e9983079
No related branches found
No related tags found
No related merge requests found
Showing
with 753 additions and 13 deletions
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic;
import java.util.Set;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.authenticate;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.authenticate;
/**
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.authenticate;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import no.bioforsk.vips.util.ServletUtil;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.authenticate;
/**
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.servlet;
import java.io.IOException;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.servlet;
import java.io.IOException;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.servlet;
import java.io.IOException;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.servlet;
import it.sauronsoftware.cron4j.Scheduler;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.servlet;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.session;
import java.util.List;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.controller.session;
import it.sauronsoftware.cron4j.Predictor;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
import java.io.Serializable;
......
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
import java.io.Serializable;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;
/**
* @copyright 2014 <a href="http://www.bioforsk.no/">Bioforsk</a>
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/
@Entity
@Table(name = "message")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Message.findAll", query = "SELECT m FROM Message m"),
@NamedQuery(name = "Message.findByMessageId", query = "SELECT m FROM Message m WHERE m.messageId = :messageId")})
public class Message implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "message_id")
private Integer messageId;
@JoinTable(name = "message_message_tag", joinColumns = {
@JoinColumn(name = "message_id", referencedColumnName = "message_id")}, inverseJoinColumns = {
@JoinColumn(name = "message_tag_id", referencedColumnName = "message_tag_id")})
@ManyToMany
private Set<MessageTag> messageTagSet;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "message")
private Set<MessageLocale> messageLocaleSet;
public Message() {
}
public Message(Integer messageId) {
this.messageId = messageId;
}
public Integer getMessageId() {
return messageId;
}
public void setMessageId(Integer messageId) {
this.messageId = messageId;
}
@XmlTransient
@JsonIgnore
public Set<MessageTag> getMessageTagSet() {
return messageTagSet;
}
public void setMessageTagSet(Set<MessageTag> messageTagSet) {
this.messageTagSet = messageTagSet;
}
@XmlTransient
@JsonIgnore
public Set<MessageLocale> getMessageLocaleSet() {
return messageLocaleSet;
}
public void setMessageLocaleSet(Set<MessageLocale> messageLocaleSet) {
this.messageLocaleSet = messageLocaleSet;
}
@Override
public int hashCode() {
int hash = 0;
hash += (messageId != null ? messageId.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
if (!(object instanceof Message)) {
return false;
}
Message other = (Message) object;
if ((this.messageId == null && other.messageId != null) || (this.messageId != null && !this.messageId.equals(other.messageId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "no.bioforsk.vips.logic.entity.Message[ messageId=" + messageId + " ]";
}
}
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
* @copyright 2014 <a href="http://www.bioforsk.no/">Bioforsk</a>
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/
@Entity
@Table(name = "message_locale")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "MessageLocale.findAll", query = "SELECT m FROM MessageLocale m"),
@NamedQuery(name = "MessageLocale.findByMessageId", query = "SELECT m FROM MessageLocale m WHERE m.messageLocalePK.messageId = :messageId"),
@NamedQuery(name = "MessageLocale.findByLocale", query = "SELECT m FROM MessageLocale m WHERE m.messageLocalePK.locale = :locale"),
@NamedQuery(name = "MessageLocale.findByHeading", query = "SELECT m FROM MessageLocale m WHERE m.heading = :heading"),
@NamedQuery(name = "MessageLocale.findByLeadParagraph", query = "SELECT m FROM MessageLocale m WHERE m.leadParagraph = :leadParagraph"),
@NamedQuery(name = "MessageLocale.findByBody", query = "SELECT m FROM MessageLocale m WHERE m.body = :body"),
@NamedQuery(name = "MessageLocale.findByPubDate", query = "SELECT m FROM MessageLocale m WHERE m.pubDate = :pubDate"),
@NamedQuery(name = "MessageLocale.findByValidToDate", query = "SELECT m FROM MessageLocale m WHERE m.validToDate = :validToDate"),
@NamedQuery(name = "MessageLocale.findByIllustration", query = "SELECT m FROM MessageLocale m WHERE m.illustration = :illustration"),
@NamedQuery(name = "MessageLocale.findByCreatedTimestamp", query = "SELECT m FROM MessageLocale m WHERE m.createdTimestamp = :createdTimestamp"),
@NamedQuery(name = "MessageLocale.findByModifiedTimestamp", query = "SELECT m FROM MessageLocale m WHERE m.modifiedTimestamp = :modifiedTimestamp")})
public class MessageLocale implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
protected MessageLocalePK messageLocalePK;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 511)
@Column(name = "heading")
private String heading;
@Size(max = 2147483647)
@Column(name = "lead_paragraph")
private String leadParagraph;
@Size(max = 2147483647)
@Column(name = "body")
private String body;
@Column(name = "pub_date")
@Temporal(TemporalType.DATE)
private Date pubDate;
@Column(name = "valid_to_date")
@Temporal(TemporalType.DATE)
private Date validToDate;
@Size(max = 2047)
@Column(name = "illustration")
private String illustration;
@Column(name = "created_timestamp")
@Temporal(TemporalType.TIMESTAMP)
private Date createdTimestamp;
@Column(name = "modified_timestamp")
@Temporal(TemporalType.TIMESTAMP)
private Date modifiedTimestamp;
@JoinColumn(name = "message_id", referencedColumnName = "message_id", insertable = false, updatable = false)
@ManyToOne(optional = false)
private Message message;
public MessageLocale() {
}
public MessageLocale(MessageLocalePK messageLocalePK) {
this.messageLocalePK = messageLocalePK;
}
public MessageLocale(MessageLocalePK messageLocalePK, String heading) {
this.messageLocalePK = messageLocalePK;
this.heading = heading;
}
public MessageLocale(int messageId, String locale) {
this.messageLocalePK = new MessageLocalePK(messageId, locale);
}
public MessageLocalePK getMessageLocalePK() {
return messageLocalePK;
}
public void setMessageLocalePK(MessageLocalePK messageLocalePK) {
this.messageLocalePK = messageLocalePK;
}
public String getHeading() {
return heading;
}
public void setHeading(String heading) {
this.heading = heading;
}
public String getLeadParagraph() {
return leadParagraph;
}
public void setLeadParagraph(String leadParagraph) {
this.leadParagraph = leadParagraph;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public Date getPubDate() {
return pubDate;
}
public void setPubDate(Date pubDate) {
this.pubDate = pubDate;
}
public Date getValidToDate() {
return validToDate;
}
public void setValidToDate(Date validToDate) {
this.validToDate = validToDate;
}
public String getIllustration() {
return illustration;
}
public void setIllustration(String illustration) {
this.illustration = illustration;
}
public Date getCreatedTimestamp() {
return createdTimestamp;
}
public void setCreatedTimestamp(Date createdTimestamp) {
this.createdTimestamp = createdTimestamp;
}
public Date getModifiedTimestamp() {
return modifiedTimestamp;
}
public void setModifiedTimestamp(Date modifiedTimestamp) {
this.modifiedTimestamp = modifiedTimestamp;
}
public Message getMessage() {
return message;
}
public void setMessage(Message message) {
this.message = message;
}
@Override
public int hashCode() {
int hash = 0;
hash += (messageLocalePK != null ? messageLocalePK.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
if (!(object instanceof MessageLocale)) {
return false;
}
MessageLocale other = (MessageLocale) object;
if ((this.messageLocalePK == null && other.messageLocalePK != null) || (this.messageLocalePK != null && !this.messageLocalePK.equals(other.messageLocalePK))) {
return false;
}
return true;
}
@Override
public String toString() {
return "no.bioforsk.vips.logic.entity.MessageLocale[ messageLocalePK=" + messageLocalePK + " ]";
}
}
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSLogic. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.logic.entity;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @copyright 2014 <a href="http://www.bioforsk.no/">Bioforsk</a>
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/
@Embeddable
public class MessageLocalePK implements Serializable {
@Basic(optional = false)
@NotNull
@Column(name = "message_id")
private int messageId;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 10)
@Column(name = "locale")
private String locale;
public MessageLocalePK() {
}
public MessageLocalePK(int messageId, String locale) {
this.messageId = messageId;
this.locale = locale;
}
public int getMessageId() {
return messageId;
}
public void setMessageId(int messageId) {
this.messageId = messageId;
}
public String getLocale() {
return locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
@Override
public int hashCode() {
int hash = 0;
hash += (int) messageId;
hash += (locale != null ? locale.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
if (!(object instanceof MessageLocalePK)) {
return false;
}
MessageLocalePK other = (MessageLocalePK) object;
if (this.messageId != other.messageId) {
return false;
}
if ((this.locale == null && other.locale != null) || (this.locale != null && !this.locale.equals(other.locale))) {
return false;
}
return true;
}
@Override
public String toString() {
return "no.bioforsk.vips.logic.entity.MessageLocalePK[ messageId=" + messageId + ", locale=" + locale + " ]";
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment