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

tidy and speed ups for similarity

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@6227 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent e23410f5
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@
<result property="featureLoc.phase" column="phase"/>
<result property="uniqueName" column="uniquename"/>
<result property="cvTerm.cvTermId" column="type_id"/>
<result property="featureProps" resultMap="FeatureProp.featureprop" />
<result property="featureProps" resultMap="FeatureProp.map-featureprop" />
<!--
<result property="featureprop.cvTerm.cvTermId" column="prop_type_id" nullValue="0"/>
<result property="featureprop.value" column="value"/>
......@@ -82,13 +82,12 @@
<result property="featureId" column="feature_id"/>
<result property="uniqueName" column="uniquename"/>
<result property="name" column="name"/>
<result property="seqLen" column="length" nullValue="-999" />
<result property="seqLen" column="length" />
<result property="cvTerm" column="type_id" select="getCvtermByCvTermId" />
<result property="featureProps" resultMap="FeatureProp.featureprop" />
<result property="featureProps" resultMap="FeatureProp.map-featureprop" />
<result property="featureDbXRefs" column="{featureId=feature_id}"
select="getFeatureDbXRef" />
<result property="dbXRef" column="dbXRefId"
select="getDbXRefByDbXRefId" />
<result property="dbXRef" resultMap="DbXRef.select-dbxref" />
</resultMap>
<resultMap id="map-feature-residues"
......@@ -227,14 +226,38 @@
organism_id AS organismId,
f.name,
f.type_id,
f.dbxref_id AS dbXRefId,
f.dbxref_id,
seqlen AS length,
fp.type_id AS prop_type_id, fp.rank AS prop_rank, fp.value
fp.type_id AS prop_type_id, fp.rank AS prop_rank, fp.value,
dbxref.*, db.*
FROM feature f
LEFT JOIN featureprop fp ON fp.feature_id=f.feature_id
LEFT JOIN dbxref ON f.dbxref_id=dbxref.dbxref_id
LEFT JOIN db ON dbxref.db_id=db.db_id
WHERE f.feature_id=$featureId$
</select>
<select id="getFeaturesByListOfIds" resultMap ="map-feature-withprop"
cacheModel="feature-cache">
SELECT
timelastmodified,
f.feature_id,
uniquename,
organism_id AS organismId,
f.name,
f.type_id,
f.dbxref_id AS dbXRefId,
seqlen AS length,
fp.type_id AS prop_type_id, fp.rank AS prop_rank, fp.value,
dbxref.*, db.*
FROM feature f
LEFT JOIN featureprop fp ON fp.feature_id=f.feature_id
LEFT JOIN dbxref ON f.dbxref_id=dbxref.dbxref_id
LEFT JOIN db ON dbxref.db_id=db.db_id
WHERE f.feature_id IN <iterate open="(" close=")" conjunction=","> $[]$ </iterate>
</select>
<!-- Returns matches for all features on a given srcfeature -->
<select id="getLazySimilarityMatches" parameterClass="java.lang.Integer"
resultMap="select-similaritymatch">
......
......@@ -10,41 +10,55 @@
<typeAlias alias="FeatureProp"
type="org.gmod.schema.sequence.FeatureProp"/>
<resultMap id="select-featureprop-lazy"
<resultMap id="map-featureprop-with-cvterm-lazy"
class="FeatureProp">
<result property="value" column="value" />
<result property="rank" column="rank" />
<result property="cvTerm" column="type_id" select="getCvtermByCvTermId" />
</resultMap>
<resultMap id="select-featureprop"
<resultMap id="map-featureprop-with-cvterm"
class="FeatureProp">
<result property="value" column="value" />
<result property="rank" column="rank" />
<result property="cvTerm" resultMap="CvTerm.lazy-cvterm" />
<result property="cvTerm" resultMap="CvTerm.lazy-cvterm" />
</resultMap>
<resultMap id="featureprop"
<resultMap id="map-featureprop"
class="FeatureProp">
<result property="value" column="value" />
<result property="rank" column="prop_rank" />
<result property="cvTerm.cvTermId" column="prop_type_id" />
</resultMap>
<resultMap id="map-feature-with-featureprops"
class="org.gmod.schema.sequence.Feature" groupBy="featureId">
<result property="featureId" column="feature_id" />
<result property="featureProps" resultMap="FeatureProp.map-featureprop-with-cvterm" />
</resultMap>
<!-- select featureprops e.g. for lazy loading -->
<select id="getFeaturePropByFeatureIdLazy" resultMap="select-featureprop-lazy">
<select id="getFeaturePropByFeatureIdLazy" resultMap="map-featureprop-with-cvterm-lazy">
SELECT type_id, value, rank
FROM featureprop
WHERE feature_id=#feature_id#
</select>
<select id="getFeaturePropByFeatureId" resultMap="select-featureprop">
<select id="getFeaturePropByFeatureId" resultMap="map-featureprop-with-cvterm">
SELECT value, rank, cvterm.*
FROM featureprop
LEFY JOIN cvterm ON type_id=cvterm_id
WHERE feature_id=#feature_id#
</select>
<select id="getFeaturePropByFeatureIds" resultMap="map-feature-with-featureprops">
SELECT f.feature_id, value, rank, cvterm.*
FROM feature f
LEFT JOIN featureprop fp ON f.feature_id=fp.feature_id
LEFT JOIN cvterm ON fp.type_id=cvterm_id
WHERE f.feature_id IN <iterate open="(" close=")" conjunction=","> $[]$ </iterate>
</select>
<update id="updateFeatureProp"
parameterClass="FeatureProp">
UPDATE featureprop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment