All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nosi.webapps.igrp.dao.TaskFile Maven / Gradle / Ivy

Go to download

IGRP Framework is a powerful and highly customizable platform developed by the Operational Nucleus for the Information Society (NOSi) to create web applications, it provides out of box, several modules to make easy to create stand-alone, production-grade web applications: authentication and access-control, business processes automation, reporting, page builder with automatic code generation and incorporation of the Once-Only-Principle, written in Java. IGRP Framework WAR - Contains some keys resources that give UI to IGRP Framework and others supports files.

There is a newer version: 2.0.0.241121-RCM
Show newest version
package nosi.webapps.igrp.dao;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * Emanuel
 * 25 Mar 2019
 */

@Entity
@Table(name="tbl_task_file")
public class TaskFile extends IGRPBaseActiveRecord implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@ManyToOne
	@JoinColumn(name="clob_fk",foreignKey=@ForeignKey(name="TASK_FILE_CLOB_FK"),nullable=false)
	private CLob clob;	

	@ManyToOne
	@JoinColumn(name="tipo_documento_etapa_fk",foreignKey=@ForeignKey(name="TIPO_DOCUMENTO_ETAPA_CLOB_FK"),nullable=false)
	private TipoDocumentoEtapa tipo_doc_task;

	@Column(name="task_id",nullable=false,length=20)
	private String taskId;
	
	private String estado = "A"; // A -> Ativo; I -> InAtivo  

	private String uuid;
	
	public TaskFile() {
		
	}
	
	public TaskFile(CLob clob, TipoDocumentoEtapa tipo_doc_task,String taskId) {
		super();
		this.clob = clob;
		this.tipo_doc_task = tipo_doc_task;
		this.taskId = taskId;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public CLob getClob() {
		return clob;
	}

	public void setClob(CLob clob) {
		this.clob = clob;
	}

	public TipoDocumentoEtapa getTipo_doc_task() {
		return tipo_doc_task;
	}

	public void setTipo_doc_task(TipoDocumentoEtapa tipo_doc_task) {
		this.tipo_doc_task = tipo_doc_task;
	}

	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}
	public String getEstado() {
		return estado;
	}

	public void setEstado(String estado) {
		this.estado = estado;
	}

	public void generateUid() {
		this.uuid = java.util.UUID.randomUUID().toString().replaceAll("-", "");
	}
	
	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	@Override
	public String toString() {
		return "TaskFile [id=" + id + ", clob=" + clob + ", tipo_doc_task=" + tipo_doc_task + ", taskId=" + taskId+",estado=" + estado + ", uuid=" + uuid +"]";
	}
	
	public void invalidate() {
		if(!this.estado.equals("I")) 
			this.estado = "I";
	}

	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy