/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans.directory.simple.entities;
import framework.beans.directory.DirectoryEntity;
import framework.beans.directory.DirectoryEntityTrash;
import framework.beans.directory.DirectoryItemDetails;
import framework.beans.directory.simple.DirectorySimpleEntity;
import framework.security.RightChecker;
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.Table;
import reportgen.cores.ejb.annotations.DefineQueryEntity;
import reportgen.cores.ejb.annotations.DefineQueryProperty;
/**
*
* @author axe
*/
@Entity
@Table(name = "commitee_restype")
@DefineQueryEntity(title="Тип результата КЭК")
public class CommitteeResolutionType extends DirectorySimpleEntity implements DirectoryEntityTrash, Serializable {
private static final long serialVersionUID = 1L;
protected final static String MSGT_ID = "Идентификатор типа результата";
@DefineQueryProperty(title=MSGT_ID)
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "comrestype_id", nullable = false)
private int id;
protected final static String MSGT_TITLE = "Название типа результата";
@DefineQueryProperty(title=MSGT_TITLE)
@Column(name = "comrestype_title", nullable = false)
private String title;
protected final static String MSGT_TRASH = "Тип результата удалён";
@DefineQueryProperty(title=MSGT_TRASH)
@Column(name = "comrestype_trash", nullable = false)
private boolean trash;
/* @OneToMany(mappedBy = "committeeRestype")
private Collection<CommitteeResolution> committeeResolutionCollection;*/
public CommitteeResolutionType() {
}
public CommitteeResolutionType(Integer id) {
this.id = id;
}
public CommitteeResolutionType(Integer id, String title) {
this.id = id;
this.title = title;
}
@Override
public int getId() {
return id;
}
@Override
public void setId(int id) {
this.id = id;
}
@Override
public String getTitle() {
return title;
}
@Override
public void setTitle(String title) {
this.title = title;
}
@Override
public boolean isTrash() {
return trash;
}
@Override
public void setTrash(boolean trash) {
this.trash = trash;
}
@Override
public DirectoryItemDetails getDetails(RightChecker rightChecker) {
DirectoryItemDetails d = new DirectoryItemDetails();
d.id = getId();
d.title = getTitle();
d.hidden = isTrash();
return d;
}
}