/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.rrm.ehour.domain;
// Generated Apr 7, 2007 1:08:18 AM by Hibernate Tools 3.2.0.beta8
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* MailLog generated by hbm2java
*/
@Entity
@Table(name = "MAIL_LOG")
@Cache(usage = CacheConcurrencyStrategy.NONE)
@Inheritance(strategy = InheritanceType.JOINED)
public class MailLog extends DomainObject<Integer, MailLog> {
private static final long serialVersionUID = -3984593984762448559L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "MAIL_LOG_ID")
private Integer mailLogId;
@Column(name = "TIMESTAMP", nullable = false)
@NotNull
private Date timestamp;
@Column(name = "SUCCESS", nullable = false)
@Type(type = "yes_no")
@NotNull
private Boolean success = Boolean.TRUE;
@Column(name = "MAIL_EVENT", length = 64)
@NotNull
private String mailEvent;
@Column(name = "MAIL_TO", length = 255)
@NotNull
private String mailTo;
public MailLog() {
}
public Integer getMailLogId() {
return mailLogId;
}
public void setMailLogId(Integer mailLogId) {
this.mailLogId = mailLogId;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getMailEvent() {
return mailEvent;
}
public void setMailEvent(String mailEvent) {
this.mailEvent = mailEvent;
}
public String getMailTo() {
return mailTo;
}
public void setMailTo(String mailTo) {
this.mailTo = mailTo;
}
@Override
public Integer getPK() {
return mailLogId;
}
public int compareTo(MailLog o) {
return getTimestamp().compareTo(o.getTimestamp());
}
public boolean equals(Object object) {
if (!(object instanceof MailLog)) {
return false;
}
MailLog rhs = (MailLog) object;
return new EqualsBuilder()
.append(this.getTimestamp(), rhs.getTimestamp())
.append(this.getSuccess(), rhs.getSuccess())
.append(this.getMailEvent(), rhs.getMailEvent())
.append(this.getMailTo(), rhs.getMailTo())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder(1202909165, -339864927)
.append(this.getTimestamp())
.append(this.getSuccess())
.append(this.getMailEvent())
.append(this.getMailTo())
.toHashCode();
}
}