From 91b774e8393afd285f612fc0c88bc8a8e57e7d38 Mon Sep 17 00:00:00 2001 From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04> Date: Fri, 8 May 2009 12:48:22 +0000 Subject: [PATCH] make PubDbXRef.xml git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@10761 ee4ac58c-ac51-4696-9907-e4b3aa274f04 --- artemis_sqlmap/Pub.xml | 22 --------------- artemis_sqlmap/PubDbXRef.xml | 39 ++++++++++++++++++++++++++ artemis_sqlmap/chado_iBatis_config.xml | 2 +- 3 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 artemis_sqlmap/PubDbXRef.xml diff --git a/artemis_sqlmap/Pub.xml b/artemis_sqlmap/Pub.xml index a678b80b5..08f38961c 100644 --- a/artemis_sqlmap/Pub.xml +++ b/artemis_sqlmap/Pub.xml @@ -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"> diff --git a/artemis_sqlmap/PubDbXRef.xml b/artemis_sqlmap/PubDbXRef.xml new file mode 100644 index 000000000..484d88eb7 --- /dev/null +++ b/artemis_sqlmap/PubDbXRef.xml @@ -0,0 +1,39 @@ +<?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 diff --git a/artemis_sqlmap/chado_iBatis_config.xml b/artemis_sqlmap/chado_iBatis_config.xml index adadbe890..9db915a0f 100644 --- a/artemis_sqlmap/chado_iBatis_config.xml +++ b/artemis_sqlmap/chado_iBatis_config.xml @@ -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" /> -- GitLab