// Path: src/main/java/org/commonwl/view/cwl/CWLToolStatus.java
// public enum CWLToolStatus {
//     DOWNLOADING,
//     RUNNING,
//     ERROR,
//     SUCCESS
// }
// 
// Path: src/main/java/org/commonwl/view/util/BaseEntity.java
// @TypeDefs({
//         @TypeDef(name = "json", typeClass = JsonBinaryType.class)
// })
// @MappedSuperclass
// public class BaseEntity {
// }


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.commonwl.view.cwl.CWLToolStatus;
import org.commonwl.view.util.BaseEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
package org.commonwl.view.workflow;



/**
 * A workflow pending completion of cwltool
 */
@JsonIgnoreProperties(value = {"id", "tempRepresentation", "workflowList"})
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Entity
@Table(name = "queued_workflow")
@SuppressWarnings("JpaAttributeTypeInspection")
public class QueuedWorkflow extends BaseEntity implements Serializable {

    // ID for database
    @Id
    @GenericGenerator(name = "uuid2", strategy = "uuid2")
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "uuid2")
    @Column(length = 36, nullable = false, updatable = false)
    public String id;

    // Very barebones workflow to build loading thumbnail and overview
    @Column(columnDefinition = "jsonb")
    @Type(type = "json")
    @Convert(disableConversion = true)
    private Workflow tempRepresentation;

    // List of packed workflows for packed workflows
    // TODO: Refactor so this is not necessary
    @Column(columnDefinition = "jsonb")
    @Type(type = "json")
    @Convert(disableConversion = true)
    private List<WorkflowOverview> workflowList;

    // Cwltool details
    @Column(columnDefinition = "jsonb")
    @Type(type = "json")
    @Convert(disableConversion = true)
// Path: src/main/java/org/commonwl/view/cwl/CWLToolStatus.java
// public enum CWLToolStatus {
//     DOWNLOADING,
//     RUNNING,
//     ERROR,
//     SUCCESS
// }
// 
// Path: src/main/java/org/commonwl/view/util/BaseEntity.java
// @TypeDefs({
//         @TypeDef(name = "json", typeClass = JsonBinaryType.class)
// })
// @MappedSuperclass
// public class BaseEntity {
// }


// Path: src/main/java/org/commonwl/view/workflow/QueuedWorkflow.java
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.commonwl.view.cwl.CWLToolStatus;
import org.commonwl.view.util.BaseEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

package org.commonwl.view.workflow;



/**
 * A workflow pending completion of cwltool
 */
@JsonIgnoreProperties(value = {"id", "tempRepresentation", "workflowList"})
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Entity
@Table(name = "queued_workflow")
@SuppressWarnings("JpaAttributeTypeInspection")
public class QueuedWorkflow extends BaseEntity implements Serializable {

    // ID for database
    @Id
    @GenericGenerator(name = "uuid2", strategy = "uuid2")
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "uuid2")
    @Column(length = 36, nullable = false, updatable = false)
    public String id;

    // Very barebones workflow to build loading thumbnail and overview
    @Column(columnDefinition = "jsonb")
    @Type(type = "json")
    @Convert(disableConversion = true)
    private Workflow tempRepresentation;

    // List of packed workflows for packed workflows
    // TODO: Refactor so this is not necessary
    @Column(columnDefinition = "jsonb")
    @Type(type = "json")
    @Convert(disableConversion = true)
    private List<WorkflowOverview> workflowList;

    // Cwltool details
    @Column(columnDefinition = "jsonb")
    @Type(type = "json")
    @Convert(disableConversion = true)
    private CWLToolStatus cwltoolStatus = CWLToolStatus.RUNNING;