package uk.ac.ebi.spot.goci.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import java.util.Collection;

/**
 * Created by emma on 01/12/14.
 *
 * @author emma
 *         <p/>
 *         A model object representing a gene and its attributes including associated single nucleotide polymorphisms
 */

@Entity
public class Gene {
    @Id
    @GeneratedValue
    private Long id;

    private String geneName;

    private String entrezGeneId;

    private String ensemblGeneId;

    @ManyToMany(mappedBy = "authorReportedGenes")
    private Collection<Locus> authorReportedFromLoci;

    @OneToMany(mappedBy = "gene")
    private Collection<GenomicContext> genomicContexts;

    // JPA no-args constructor
    public Gene() {
    }

    public Gene(String geneName,
                String entrezGeneId,
                String ensemblGeneId,
                Collection<Locus> authorReportedFromLoci,
                Collection<GenomicContext> genomicContexts) {
        this.geneName = geneName;
        this.entrezGeneId = entrezGeneId;
        this.ensemblGeneId = ensemblGeneId;
        this.authorReportedFromLoci = authorReportedFromLoci;
        this.genomicContexts = genomicContexts;
    }

    public Gene(String geneName) {
        this.geneName = geneName;
    }

    public Long getId() {
        return id;
    }

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

    public String getGeneName() {
        return geneName;
    }

    public void setGeneName(String geneName) {
        this.geneName = geneName;
    }

    public String getEntrezGeneId() {
        return entrezGeneId;
    }

    public void setEntrezGeneId(String entrezGeneId) {
        this.entrezGeneId = entrezGeneId;
    }

    public Collection<Locus> getAuthorReportedFromLoci() {
        return authorReportedFromLoci;
    }

    public void setAuthorReportedFromLoci(Collection<Locus> authorReportedFromLoci) {
        this.authorReportedFromLoci = authorReportedFromLoci;
    }

    public String getEnsemblGeneId() {
        return ensemblGeneId;
    }

    public void setEnsemblGeneId(String ensemblGeneId) {
        this.ensemblGeneId = ensemblGeneId;
    }

    public Collection<GenomicContext> getGenomicContexts() {
        return genomicContexts;
    }

    public void setGenomicContexts(Collection<GenomicContext> genomicContexts) {
        this.genomicContexts = genomicContexts;
    }

    @Override public String toString() {
        return "Gene{" +
                "id=" + id +
                ", geneName='" + geneName + '\'' +
                ", entrezGeneId='" + entrezGeneId + '\'' +
                ", ensemblGeneId='" + ensemblGeneId + '\'' +
                ", authorReportedFromLoci=" + authorReportedFromLoci +
                ", genomicContexts=" + genomicContexts +
                '}';
    }
}

@@ -852,32 +852,294 @@
 Gene() %7B%0A    %7D%0A%0A
+    // Light constructor%0A    public Gene(String geneName,%0A                String entrezGeneId,%0A                String ensemblGeneId) %7B%0A        this.geneName = geneName;%0A        this.entrezGeneId = entrezGeneId;%0A        this.ensemblGeneId = ensemblGeneId;%0A    %7D%0A%0A
     public Gene(

Add a light constructor for the Ensembl pipeline