Skip to content

Commit 918c371

Browse files
committed
Fix skipping rows in generic assay data
MyBatis does not like if result does not have <id ...> If it is not specified, it picks first field as a key. Rows that would have the same key will be skipped!
1 parent 1bcb95b commit 918c371

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/main/java/org/cbioportal/application/file/export/exporters/GenericAssayLimitValueDatatypeExporter.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
public class GenericAssayLimitValueDatatypeExporter extends GeneticProfileDatatypeExporter {
2222

23-
private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(GenericAssayLimitValueDatatypeExporter.class);
2423
private final GeneticProfileDataService geneticProfileDataService;
2524

2625
public GenericAssayLimitValueDatatypeExporter(GeneticProfileService geneticProfileService, GeneticProfileDataService geneticProfileDataService) {
@@ -92,9 +91,7 @@ public TableRow next() {
9291
GenericEntityProperty property = null;
9392
while (propertyPeekingIterator.hasNext() && propertyPeekingIterator.peek().getGeneticEntityId() <= data.getGeneticEntity().getGeneticEntityId()) {
9493
if (propertyPeekingIterator.peek().getGeneticEntityId() < data.getGeneticEntity().getGeneticEntityId()) {
95-
LOG.warn("Skipping {} property with genetic entity ID {} as such ID is not present in the result set.", propertyPeekingIterator.peek().getName(), propertyPeekingIterator.peek().getGeneticEntityId());
96-
propertyPeekingIterator.next();
97-
continue;
94+
throw new IllegalStateException(String.format("%s property with genetic entity ID %d is not present in the result set.", propertyPeekingIterator.peek().getName(), propertyPeekingIterator.peek().getGeneticEntityId()));
9895
}
9996
property = propertyPeekingIterator.next();
10097
if (property.getName() == null) {

src/main/resources/mappers/export/CaseListMetadataMapper.xml

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<mapper namespace="org.cbioportal.application.file.export.mappers.CaseListMetadataMapper">
55
<resultMap id="CaseListMetadataResultMap" type="org.cbioportal.application.file.model.CaseListMetadata">
6+
<id column="LIST_ID"/>
67
<result property="cancerStudyIdentifier" column="cancerStudyIdentifier"/>
78
<result property="stableId" column="stableId"/>
89
<result property="name" column="name"/>
@@ -15,11 +16,12 @@
1516
id="getCaseListsMetadata"
1617
resultMap="CaseListMetadataResultMap">
1718
SELECT
18-
cs.CANCER_STUDY_IDENTIFIER as cancerStudyIdentifier,
19-
sl.STABLE_ID as stableId,
20-
sl.NAME as name,
21-
sl.DESCRIPTION as description,
22-
s.STABLE_ID as sampleId
19+
sl.LIST_ID,
20+
cs.CANCER_STUDY_IDENTIFIER as cancerStudyIdentifier,
21+
sl.STABLE_ID as stableId,
22+
sl.NAME as name,
23+
sl.DESCRIPTION as description,
24+
s.STABLE_ID as sampleId
2325
FROM sample_list sl
2426
JOIN cancer_study cs ON cs.CANCER_STUDY_ID = sl.CANCER_STUDY_ID
2527
JOIN sample_list_list sll ON sll.LIST_ID = sl.LIST_ID

src/main/resources/mappers/export/GeneticProfileDataMapper.xml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
ORDER BY jt.idx ASC
2020
</select>
2121
<resultMap id="GeneticProfileDataResultMap" type="org.cbioportal.application.file.model.GeneticProfileData">
22+
<id column="GENETIC_ENTITY_ID"/>
2223
<result property="commaSeparatedValues" column="VALUES"/>
2324
<association property="geneticEntity" javaType="org.cbioportal.application.file.model.GeneticEntity">
2425
<id property="geneticEntityId" column="GENETIC_ENTITY_ID"/>
@@ -46,6 +47,7 @@
4647
ORDER BY ga.GENETIC_ENTITY_ID
4748
</select>
4849
<resultMap id="GeneticEntityPropertyResultMap" type="org.cbioportal.application.file.model.GenericEntityProperty">
50+
<id column="ID"/>
4951
<result property="geneticEntityId" column="GENETIC_ENTITY_ID"/>
5052
<result property="name" column="NAME"/>
5153
<result property="value" column="VALUE"/>

0 commit comments

Comments
 (0)