package com.thingtrack.konekti.domain;
/*
* #%L
* Konekti Domain Layer
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2010 - 2014 Thingtrack s.l.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.io.Serializable;
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.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
* Entity class
* <p>
* Represents any report produced by Konekti
* @author Thingtrack S.L.
*
*/
@SuppressWarnings("serial")
@Entity
@Table(name="REPORT")
public class Report implements Serializable {
/**
* Unique identifier
*/
@Id
@Column(name="REPORT_ID")
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer reportId;
/**
* {@link Organization} owner
*/
@ManyToOne
@JoinColumn(name="ORGANIZATION_ID")
private Organization organization;
/**
* Code, not null
*/
@Column(name="CODE", nullable=false, length=64)
private String code;
/**
* Description
*/
@Column(name="DESCRIPTION", length=512)
private String description;
/**
* The report content in bytes
*/
@Column(name="TEMPLATE")
@Lob
private byte[] template;
/**
* Active, not null
*/
@Column(name="ACTIVE", nullable=false)
private boolean active=true;
/**
* @return the reportId
*/
public Integer getReportId() {
return reportId;
}
/**
* @param reportId the reportId to set
*/
public void setReportId(Integer reportId) {
this.reportId = reportId;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the active
*/
public boolean isActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(boolean active) {
this.active = active;
}
/**
* @return the organization
*/
public Organization getOrganization() {
return organization;
}
/**
* @param organization the organization to set
*/
public void setOrganization(Organization organization) {
this.organization = organization;
}
/**
* @return the code
*/
public String getCode() {
return code;
}
/**
* @param code the code to set
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return the template
*/
public byte[] getTemplate() {
return template;
}
/**
* @param template the template to set
*/
public void setTemplate(byte[] template) {
this.template = template;
}
}