/**
* Copyright (c)2010-2011 Enterprise Website Content Management System(EWCMS), All rights reserved.
* EWCMS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
* http://www.ewcms.com
*/
package com.ewcms.plugin.report.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.codehaus.jackson.annotate.JsonIgnore;
/**
*
* @author wu_zhijun
*
*/
@Entity
@Table(name = "plugin_report_repository")
@SequenceGenerator(name = "seq_plugin_report_repository", sequenceName = "seq_plugin_report_repository_id", allocationSize = 1)
public class Repository implements Serializable {
private static final long serialVersionUID = -1166379145505781440L;
@Id
@GeneratedValue(generator = "seq_plugin_report_repository", strategy = GenerationType.SEQUENCE)
@Column(name = "id")
private Long id;
@Column(name = "name", nullable = false)
private String name;
@Column(name = "description", columnDefinition = "text")
private String description;
@Column(name = "entity")
private byte[] entity;
@Column(name = "type")
private String type;
@Temporal(value = TemporalType.TIMESTAMP)
@Column(name = "updatedate")
private Date updateDate;
@Temporal(value = TemporalType.TIMESTAMP)
@Column(name = "publishdate")
private Date publishDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@JsonIgnore
public byte[] getEntity() {
return entity;
}
public void setEntity(byte[] entity) {
this.entity = entity;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public Date getPublishDate() {
return publishDate;
}
public void setPublishDate(Date publishDate) {
this.publishDate = publishDate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Repository other = (Repository) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}