<commit_before>package org.mskcc.cbio.oncokb.model;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.mskcc.cbio.oncokb.model.oncotree.TumorType;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.mskcc.cbio.oncokb.util.TumorTypeUtils;

import javax.persistence.*;
import java.util.*;


/**
 * Evidence generated by hbm2java
 *
 * @author jgao, <NAME>
 */
@NamedQueries({
    @NamedQuery(
        name = "findEvidencesByAlteration",
        query = "select e from Evidence e join e.alterations a where a.id=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndTumorType",
        query = "select e from Evidence e join e.alterations a where a.id=:alt and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndCancerType",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndCancerTypeNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndTumorTypesAndEvidenceTypes",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and (e.cancerType in (:tts) or e.subtype in (:tt)) and  e.evidenceType in (:ets)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypes",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypesNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets) and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndSubtypesAndEvidenceTypes",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.subtype in (:tts) and  e.evidenceType in (:ets)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndTumorTypesAndEvidenceTypesAndLevelOfEvidence",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and (e.cancerType in (:tts) or e.subtype in (:tts)) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypesAndLevelOfEvidence",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypesAndLevelOfEvidenceNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les) and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndSubtypesAndEvidenceTypesAndLevelOfEvidence",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.subtype in (:tts) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceType",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndLevels",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.levelOfEvidence=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndTumorType",
        query = "select e from Evidence e join e.alterations a where a.id=:alt and e.evidenceType=:et and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndCancerType",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndCancerTypeNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGene",
        query = "select e from Evidence e where e.gene=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceType",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndTumorType",
        query = "select e from Evidence e where e.gene=:g and e.evidenceType=:et and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndCancerType",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndCancerTypeNoSubtype",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=? and e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndSubtype",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByTumorType",
        query = "select e from Evidence e where (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByCancerType",
        query = "select e from Evidence e where e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByCancerTypeNoSubtype",
        query = "select e from Evidence e where e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesBySubtype",
        query = "select e from Evidence e where e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndTumorType",
        query = "select e from Evidence e join e.alterations a where e.gene=:g and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndCancerType",
        query = "select e from Evidence e join e.alterations a where e.gene=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndSubtype",
        query = "select e from Evidence e join e.alterations a where e.gene=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByIds",
        query = "select e from Evidence e where e.id in (:ids)"
    ),
    @NamedQuery(
        name = "findEvidencesByUUIDs",
        query = "select e from Evidence e where e.uuid in (:uuids)"
    ),
    @NamedQuery(
        name = "findTumorTypesWithEvidencesForAlterations",
        query = "select distinct e.cancerType, e.subtype from Evidence e join e.alterations a where a.id in (:alts)"
    ),
    @NamedQuery(
        name = "findCancerTypesWithEvidencesForAlterations",
        query = "select distinct e.cancerType from Evidence e join e.alterations a where a.id in (:alts)"
    ),
    @NamedQuery(
        name = "findSubtypesWithEvidencesForAlterations",
        query = "select distinct e.subtype from Evidence e join e.alterations a where a.id in (:alts)"
    ),
    @NamedQuery(
        name = "findAllCancerTypes",
        query = "select distinct e.cancerType from Evidence e where e.cancerType is not null"
    ),
    @NamedQuery(
        name = "findAllSubtypes",
        query = "select distinct e.subtype from Evidence e where e.subtype is not null"
    ),
    @NamedQuery(
        name = "findEvidenceByUUIDs",
        query = "select e from Evidence e where e.uuid in (:uuids)"
    ),
})

@Entity
@Table(name = "evidence")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Evidence implements java.io.Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(length = 40)
    private String uuid;

    @Column(name = "evidence_type")
    @Enumerated(EnumType.STRING)
    private EvidenceType evidenceType;

    @Column(name = "cancer_type", length = 100)
    private String cancerType;

    @Column(length = 50)
    private String subtype;

    @Transient
    private TumorType oncoTreeType;

    @ManyToOne(fetch = FetchType.EAGER)
    @Fetch(FetchMode.JOIN)
    @JoinColumn(name = "entrez_gene_id")
    private Gene gene;<commit_msg>Revert "Show uuid in api returned data"<commit_after>package org.mskcc.cbio.oncokb.model;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.mskcc.cbio.oncokb.model.oncotree.TumorType;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.mskcc.cbio.oncokb.util.TumorTypeUtils;

import javax.persistence.*;
import java.util.*;


/**
 * Evidence generated by hbm2java
 *
 * @author jgao, <NAME>
 */
@NamedQueries({
    @NamedQuery(
        name = "findEvidencesByAlteration",
        query = "select e from Evidence e join e.alterations a where a.id=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndTumorType",
        query = "select e from Evidence e join e.alterations a where a.id=:alt and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndCancerType",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndCancerTypeNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndTumorTypesAndEvidenceTypes",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and (e.cancerType in (:tts) or e.subtype in (:tt)) and  e.evidenceType in (:ets)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypes",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypesNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets) and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndSubtypesAndEvidenceTypes",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.subtype in (:tts) and  e.evidenceType in (:ets)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndTumorTypesAndEvidenceTypesAndLevelOfEvidence",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and (e.cancerType in (:tts) or e.subtype in (:tts)) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypesAndLevelOfEvidence",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndCancerTypesAndEvidenceTypesAndLevelOfEvidenceNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.cancerType in (:tts) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les) and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationsAndSubtypesAndEvidenceTypesAndLevelOfEvidence",
        query = "select e from Evidence e join e.alterations a where a.id in (:alts) and e.subtype in (:tts) and  e.evidenceType in (:ets) and e.levelOfEvidence in (:les)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceType",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndLevels",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.levelOfEvidence=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndTumorType",
        query = "select e from Evidence e join e.alterations a where a.id=:alt and e.evidenceType=:et and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndCancerType",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndCancerTypeNoSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByAlterationAndEvidenceTypeAndSubtype",
        query = "select e from Evidence e join e.alterations a where a.id=? and e.evidenceType=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGene",
        query = "select e from Evidence e where e.gene=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceType",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndTumorType",
        query = "select e from Evidence e where e.gene=:g and e.evidenceType=:et and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndCancerType",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndCancerTypeNoSubtype",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=? and e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndEvidenceTypeAndSubtype",
        query = "select e from Evidence e where e.gene=? and e.evidenceType=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByTumorType",
        query = "select e from Evidence e where (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByCancerType",
        query = "select e from Evidence e where e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByCancerTypeNoSubtype",
        query = "select e from Evidence e where e.cancerType=? and e.subtype is null"
    ),
    @NamedQuery(
        name = "findEvidencesBySubtype",
        query = "select e from Evidence e where e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndTumorType",
        query = "select e from Evidence e join e.alterations a where e.gene=:g and (e.cancerType=:tt or e.subtype=:tt)"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndCancerType",
        query = "select e from Evidence e join e.alterations a where e.gene=? and e.cancerType=?"
    ),
    @NamedQuery(
        name = "findEvidencesByGeneAndSubtype",
        query = "select e from Evidence e join e.alterations a where e.gene=? and e.subtype=?"
    ),
    @NamedQuery(
        name = "findEvidencesByIds",
        query = "select e from Evidence e where e.id in (:ids)"
    ),
    @NamedQuery(
        name = "findEvidencesByUUIDs",
        query = "select e from Evidence e where e.uuid in (:uuids)"
    ),
    @NamedQuery(
        name = "findTumorTypesWithEvidencesForAlterations",
        query = "select distinct e.cancerType, e.subtype from Evidence e join e.alterations a where a.id in (:alts)"
    ),
    @NamedQuery(
        name = "findCancerTypesWithEvidencesForAlterations",
        query = "select distinct e.cancerType from Evidence e join e.alterations a where a.id in (:alts)"
    ),
    @NamedQuery(
        name = "findSubtypesWithEvidencesForAlterations",
        query = "select distinct e.subtype from Evidence e join e.alterations a where a.id in (:alts)"
    ),
    @NamedQuery(
        name = "findAllCancerTypes",
        query = "select distinct e.cancerType from Evidence e where e.cancerType is not null"
    ),
    @NamedQuery(
        name = "findAllSubtypes",
        query = "select distinct e.subtype from Evidence e where e.subtype is not null"
    ),
    @NamedQuery(
        name = "findEvidenceByUUIDs",
        query = "select e from Evidence e where e.uuid in (:uuids)"
    ),
})

@Entity
@Table(name = "evidence")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Evidence implements java.io.Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(length = 40)
    @JsonIgnore
    private String uuid;

    @Column(name = "evidence_type")
    @Enumerated(EnumType.STRING)
    private EvidenceType evidenceType;

    @Column(name = "cancer_type", length = 100)
    private String cancerType;

    @Column(length = 50)
    private String subtype;

    @Transient
    private TumorType oncoTreeType;

    @ManyToOne(fetch = FetchType.EAGER)
    @Fetch(FetchMode.JOIN)
    @JoinColumn(name = "entrez_gene_id")
    private Gene gene;
{'fraction_non_alphanumeric': 0.10331161780673181, 'fraction_numerical': 0.0008686210640608035, 'mean_word_length': 3.2076290543627226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1562441', 'n_tokens_mistral': 6194, 'n_tokens_neox': 5697, 'n_words': 1630}