diff --git a/artemis_sqlmap/Pub.xml b/artemis_sqlmap/Pub.xml index a678b80b5e7f20bcc205fab58a74fc286538c2c1..08f38961c7dcc6881a27ffaa1e18e8dad969ef0d 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 0000000000000000000000000000000000000000..484d88eb71fb2481e591221e5b3b90926e4fc386 --- /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 adadbe89081800606ef38cc4fcfb3736d7b835c9..9db915a0f7e9a795da281c24a102bba6cfabed01 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" />