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

make PubDbXRef.xml

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@10761 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 02277d81
No related branches found
No related tags found
No related merge requests found
......@@ -9,9 +9,6 @@
<typeAlias alias="Pub"
type="org.gmod.schema.pub.Pub"/>
<typeAlias alias="PubDbXRef"
type="org.gmod.schema.pub.PubDbXRef"/>
<resultMap id="select-pub"
class="Pub">
......@@ -30,17 +27,6 @@
<result property="pubPlace" column="pubplace" />
<result property="cvTerm" column="type_id" select="getCvtermByCvTermId" />
</resultMap>
<resultMap id="select-pubdbxref" class="PubDbXRef">
<result property="pub.pubId" column="pub_id" />
<result property="dbXRef.accession" column="accession" />
<result property="dbXRef.version" column="version" />
<result property="dbXRef.description" column="dbx_description" />
<result property="dbXRef.db.name" column="name" />
<result property="dbXRef.db.description" column="description" />
<result property="dbXRef.db.urlPrefix" column="urlprefix" />
<result property="dbXRef.db.url" column="url" />
</resultMap>
<!-- SQL -->
......@@ -51,14 +37,6 @@
<select id="getPubByUniqueName" resultMap="select-pub">
SELECT * FROM pub WHERE uniquename=#uniqueName#
</select>
<select id="getPubDbXRef" resultMap="select-pubdbxref">
select pub_id, pub_dbxref.dbxref_id,
accession, version, dbx.description AS dbx_description,
db.name, db.description, db.urlprefix, db.url FROM pub_dbxref
LEFT JOIN dbxref dbx ON pub_dbxref.dbxref_id=dbx.dbxref_id
LEFT JOIN db ON db.db_id=dbx.db_id
</select>
<!-- WRITE BACK -->
<insert id="insertPub" parameterClass="Pub">
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="PubDbXRef">
<typeAlias alias="PubDbXRef"
type="org.gmod.schema.pub.PubDbXRef"/>
<resultMap id="select-pubdbxref" class="PubDbXRef">
<result property="pub.pubId" column="pub_id" />
<result property="dbXRef.accession" column="accession" />
<result property="dbXRef.version" column="version" />
<result property="dbXRef.description" column="dbx_description" />
<result property="dbXRef.db.name" column="name" />
<result property="dbXRef.db.description" column="description" />
<result property="dbXRef.db.urlPrefix" column="urlprefix" />
<result property="dbXRef.db.url" column="url" />
</resultMap>
<!-- SQL -->
<select id="getPubDbXRef" resultMap="select-pubdbxref">
select pub_id, pub_dbxref.dbxref_id,
accession, version, dbx.description AS dbx_description,
db.name, db.description, db.urlprefix, db.url FROM pub_dbxref
LEFT JOIN dbxref dbx ON pub_dbxref.dbxref_id=dbx.dbxref_id
LEFT JOIN db ON db.db_id=dbx.db_id
</select>
<!-- WRITE BACK -->
<insert id="insertPubDbXRef" parameterClass="PubDbXRef">
INSERT INTO pub_dbxref ( pub_id, dbxref_id )
VALUES ( $pub.pubId$, $dbXRef.dbXRefId$ )
</insert>
</sqlMap>
\ No newline at end of file
......@@ -75,11 +75,11 @@
<!-- Identify all SQL Map XML files to be loaded by this SQL map. Notice the paths
are relative to the classpath. -->
<sqlMap resource="artemis_sqlmap/Cv.xml" />
<sqlMap resource="artemis_sqlmap/CvTerm.xml" />
<sqlMap resource="artemis_sqlmap/Pub.xml" />
<sqlMap resource="artemis_sqlmap/PubDbXRef.xml" />
<sqlMap resource="artemis_sqlmap/Feature.xml" />
<sqlMap resource="artemis_sqlmap/Organism.xml" />
<sqlMap resource="artemis_sqlmap/OrganismProp.xml" />
......
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