Skip to content
Snippets Groups Projects
Commit 1d807b01 authored by tjc's avatar tjc
Browse files

updates

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@6397 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 58b00f61
No related branches found
No related tags found
No related merge requests found
...@@ -49,11 +49,12 @@ ...@@ -49,11 +49,12 @@
<result property="featureRelationshipId" column="feature_relationship_id"/> <result property="featureRelationshipId" column="feature_relationship_id"/>
<result property="featureBySubjectId" column="subject_id" <result property="featureBySubjectId" column="subject_id"
select="getLazyFeatureById" /> select="getLazyFeatureById" />
<result property="featureByObjectId" column="object_id" <!--<result property="featureByObjectId" column="object_id"
select="getLazyFeatureNameAndTypeById" /> select="getLazyFeatureNameAndTypeById" />-->
<result property="featureByObjectId" resultMap="Feature.map-feature-name-lazy" />
<result property="value" column="value" /> <result property="value" column="value" />
<result property="rank" column="rank" /> <result property="rank" column="rank" />
<result property="cvTerm.name" column="name" /> <result property="cvTerm.name" column="fr_name" />
</resultMap> </resultMap>
<!-- select feature_relationship --> <!-- select feature_relationship -->
...@@ -72,13 +73,69 @@ ...@@ -72,13 +73,69 @@
</select> </select>
<select id="getParentFeatureRelationship" resultMap="map-parent-relationship"> <select id="getParentFeatureRelationship" resultMap="map-parent-relationship">
SELECT feature_relationship_id, subject_id, object_id, type_id, value, rank, cvterm.name SELECT feature_relationship_id, subject_id, object_id, value, rank,
FROM feature_relationship fr_cvterm.name AS fr_name, parent.uniquename, parent_cvterm.name AS name, parent.feature_id AS id
LEFT JOIN cvterm ON cvterm_id=type_id FROM feature_relationship AS fr
LEFT JOIN cvterm AS fr_cvterm ON fr_cvterm.cvterm_id=fr.type_id
LEFT JOIN feature AS parent ON object_id=feature_id
LEFT JOIN cvterm AS parent_cvterm ON parent_cvterm.cvterm_id=parent.type_id
WHERE subject_id=#subject_id# AND WHERE subject_id=#subject_id# AND
( cvterm.name='derives_from' OR cvterm.name='part_of' OR cvterm.name='proper_part_of' ) ( fr_cvterm.name='derives_from' OR fr_cvterm.name='part_of' OR fr_cvterm.name='proper_part_of' )
<!--
SELECT feature_relationship_id, subject_id, object_id, value, rank,
fr_cvterm.name AS fr_name, parent.uniquename, parent_cvterm.name, parent.feature_id AS id
FROM feature_relationship AS fr
LEFT JOIN cvterm AS fr_cvterm ON fr_cvterm.cvterm_id=fr.type_id
LEFT JOIN feature AS parent ON object_id=feature_id
LEFT JOIN cvterm AS parent_cvterm ON parent_cvterm.cvterm_id=parent.type_id
WHERE
( subject_id=#subject_id#
AND (fr_cvterm.name='derives_from' OR fr_cvterm.name='part_of' OR fr_cvterm.name='proper_part_of')
AND (parent_cvterm.name='gene' OR parent_cvterm.name='pseudogene'))
OR ( subject_id IN (SELECT object_id FROM feature_relationship AS fr2
LEFT JOIN cvterm AS fr2_cvterm ON fr2_cvterm.cvterm_id=fr2.type_id
WHERE subject_id=#subject_id#
AND (fr2_cvterm.name='derives_from' OR fr2_cvterm.name='part_of' OR fr2_cvterm.name='proper_part_of'))
AND (fr_cvterm.name='derives_from' OR fr_cvterm.name='part_of' OR fr_cvterm.name='proper_part_of')
AND (parent_cvterm.name='gene' OR parent_cvterm.name='pseudogene')) ;
-->
</select> </select>
<select id="getParentFeaturesByChildFeatureIds" resultMap="map-parent-relationship">
SELECT feature_relationship_id, subject_id, object_id, value, rank,
fr_cvterm.name AS fr_name, parent.uniquename, parent_cvterm.name AS name, parent.feature_id AS id
FROM feature_relationship AS fr
LEFT JOIN cvterm AS fr_cvterm ON fr_cvterm.cvterm_id=fr.type_id
LEFT JOIN feature AS parent ON object_id=feature_id
LEFT JOIN cvterm AS parent_cvterm ON parent_cvterm.cvterm_id=parent.type_id
WHERE
( subject_id IN <iterate open="(" close=")" conjunction=","> $[]$ </iterate>
AND (fr_cvterm.name='derives_from' OR fr_cvterm.name='part_of' OR fr_cvterm.name='proper_part_of') )
</select>
<!--
<select id="getGeneFeaturesByChildFeatureIds" resultMap="map-parent-relationship">
SELECT feature_relationship_id, subject_id, object_id, value, rank,
fr_cvterm.name AS fr_name, parent.uniquename, parent_cvterm.name AS name, parent.feature_id AS id
FROM feature_relationship AS fr
LEFT JOIN cvterm AS fr_cvterm ON fr_cvterm.cvterm_id=fr.type_id
LEFT JOIN feature AS parent ON object_id=feature_id
LEFT JOIN cvterm AS parent_cvterm ON parent_cvterm.cvterm_id=parent.type_id
WHERE
( subject_id IN <iterate open="(" close=")" conjunction=","> $[]$ </iterate>
AND (fr_cvterm.name='derives_from' OR fr_cvterm.name='part_of' OR fr_cvterm.name='proper_part_of')
AND (parent_cvterm.name='gene' OR parent_cvterm.name='pseudogene') )
OR ( subject_id IN (SELECT object_id FROM feature_relationship AS fr2
LEFT JOIN cvterm AS fr2_cvterm ON fr2_cvterm.cvterm_id=fr2.type_id
WHERE subject_id IN <iterate open="(" close=")" conjunction=","> $[]$ </iterate>
AND (fr2_cvterm.name='derives_from' OR fr2_cvterm.name='part_of' OR fr2_cvterm.name='proper_part_of'))
AND (fr_cvterm.name='derives_from' OR fr_cvterm.name='part_of' OR fr_cvterm.name='proper_part_of')
AND (parent_cvterm.name='gene' OR parent_cvterm.name='pseudogene') ) ;
</select>
-->
<update id="updateFeatureRelationshipsForSubjectId" <update id="updateFeatureRelationshipsForSubjectId"
parameterClass="FeatureRelationship"> parameterClass="FeatureRelationship">
UPDATE feature_relationship UPDATE feature_relationship
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment