Skip to content

Commit dd5e8f2

Browse files
committed
fix Patient Mapper select SQL prefix
1 parent 9ba6e78 commit dd5e8f2

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

src/main/resources/org/cbioportal/legacy/persistence/mybatis/PatientMapper.xml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@
33

44
<mapper namespace="org.cbioportal.legacy.persistence.mybatis.PatientMapper">
55

6+
<!-- TODO: we should eventually get rid of the ${prefix} and the quotes if possible -->
67
<sql id="select">
78
patient.internal_id AS "${prefix}internalId",
89
patient.stable_id AS "${prefix}stableId",
910
patient.cancer_study_id AS "${prefix}cancerStudyId",
1011
cancer_study.cancer_study_identifier AS "${prefix}cancerStudyIdentifier"
1112
<if test="projection == 'DETAILED'">
1213
,
13-
cancer_study.cancer_study_id AS "cancerStudy.cancerStudyId",
14-
cancer_study.cancer_study_identifier AS "cancerStudy.cancerStudyIdentifier",
15-
cancer_study.type_of_cancer_id AS "cancerStudy.typeOfCancerId",
16-
cancer_study.name AS "cancerStudy.name",
17-
cancer_study.description AS "cancerStudy.description",
18-
cancer_study.public AS "cancerStudy.publicStudy",
19-
cancer_study.pmid AS "cancerStudy.pmid",
20-
cancer_study.citation AS "cancerStudy.citation",
21-
cancer_study.groups AS "cancerStudy.groups",
22-
cancer_study.status AS "cancerStudy.status",
23-
cancer_study.import_date AS "cancerStudy.importDate",
24-
reference_genome.name AS "cancerStudy.referenceGenome"
14+
cancer_study.cancer_study_id AS "${prefix}cancerStudy.cancerStudyId",
15+
cancer_study.cancer_study_identifier AS "${prefix}cancerStudy.cancerStudyIdentifier",
16+
cancer_study.type_of_cancer_id AS "${prefix}cancerStudy.typeOfCancerId",
17+
cancer_study.name AS "${prefix}cancerStudy.name",
18+
cancer_study.description AS "${prefix}cancerStudy.description",
19+
cancer_study.public AS "${prefix}cancerStudy.publicStudy",
20+
cancer_study.pmid AS "${prefix}cancerStudy.pmid",
21+
cancer_study.citation AS "${prefix}cancerStudy.citation",
22+
cancer_study.groups AS "${prefix}cancerStudy.groups",
23+
cancer_study.status AS "${prefix}cancerStudy.status",
24+
cancer_study.import_date AS "${prefix}cancerStudy.importDate",
25+
reference_genome.name AS "${prefix}cancerStudy.referenceGenome"
2526
</if>
2627
</sql>
2728

src/test/java/org/cbioportal/legacy/persistence/mybatis/SampleMyBatisRepositoryTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ public void getAllSamplesInStudyDetailedProjection() throws Exception {
8989
Assert.assertEquals("brca", cancerStudy.getTypeOfCancerId());
9090
Assert.assertEquals("Breast Invasive Carcinoma (TCGA, Nature 2012)", cancerStudy.getName());
9191
Assert.assertEquals(
92-
"<a href=\\\"http://cancergenome.nih.gov/\\\">The Cancer Genome Atlas (TCGA)</a> Breast"
93-
+ " Invasive Carcinoma project. 825 cases.<br><i>Nature 2012.</i> <a href=\\\"http://tcga-data.nci."
94-
+ "nih.gov/tcga/\\\">Raw data via the TCGA Data Portal</a>.",
92+
"<a href=\"http://cancergenome.nih.gov/\">The Cancer Genome Atlas (TCGA)</a> Breast"
93+
+ " Invasive Carcinoma project. 825 cases.<br><i>Nature 2012.</i> <a href=\"http://tcga-data.nci."
94+
+ "nih.gov/tcga/\">Raw data via the TCGA Data Portal</a>.",
9595
cancerStudy.getDescription());
9696
Assert.assertEquals(true, cancerStudy.getPublicStudy());
9797
Assert.assertEquals("23000897,26451490", cancerStudy.getPmid());
@@ -162,9 +162,9 @@ public void getSampleInStudy() throws Exception {
162162
Assert.assertEquals("brca", cancerStudy.getTypeOfCancerId());
163163
Assert.assertEquals("Breast Invasive Carcinoma (TCGA, Nature 2012)", cancerStudy.getName());
164164
Assert.assertEquals(
165-
"<a href=\\\"http://cancergenome.nih.gov/\\\">The Cancer Genome Atlas (TCGA)</a> Breast"
166-
+ " Invasive Carcinoma project. 825 cases.<br><i>Nature 2012.</i> <a href=\\\"http://tcga-data.nci."
167-
+ "nih.gov/tcga/\\\">Raw data via the TCGA Data Portal</a>.",
165+
"<a href=\"http://cancergenome.nih.gov/\">The Cancer Genome Atlas (TCGA)</a> Breast"
166+
+ " Invasive Carcinoma project. 825 cases.<br><i>Nature 2012.</i> <a href=\"http://tcga-data.nci."
167+
+ "nih.gov/tcga/\">Raw data via the TCGA Data Portal</a>.",
168168
cancerStudy.getDescription());
169169
Assert.assertEquals(true, cancerStudy.getPublicStudy());
170170
Assert.assertEquals("23000897,26451490", cancerStudy.getPmid());
@@ -229,9 +229,9 @@ public void getAllSamplesOfPatientInStudyDetailedProjection() throws Exception {
229229
Assert.assertEquals("brca", cancerStudy.getTypeOfCancerId());
230230
Assert.assertEquals("Breast Invasive Carcinoma (TCGA, Nature 2012)", cancerStudy.getName());
231231
Assert.assertEquals(
232-
"<a href=\\\"http://cancergenome.nih.gov/\\\">The Cancer Genome Atlas (TCGA)</a> Breast"
233-
+ " Invasive Carcinoma project. 825 cases.<br><i>Nature 2012.</i> <a href=\\\"http://tcga-data.nci."
234-
+ "nih.gov/tcga/\\\">Raw data via the TCGA Data Portal</a>.",
232+
"<a href=\"http://cancergenome.nih.gov/\">The Cancer Genome Atlas (TCGA)</a> Breast"
233+
+ " Invasive Carcinoma project. 825 cases.<br><i>Nature 2012.</i> <a href=\"http://tcga-data.nci."
234+
+ "nih.gov/tcga/\">Raw data via the TCGA Data Portal</a>.",
235235
cancerStudy.getDescription());
236236
Assert.assertEquals(true, cancerStudy.getPublicStudy());
237237
Assert.assertEquals("23000897,26451490", cancerStudy.getPmid());

0 commit comments

Comments
 (0)