File: PubDbXRef.xml

package info (click to toggle)
artemis 17.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 112,044 kB
  • sloc: java: 451,938; sh: 3,370; xml: 2,292; makefile: 182; perl: 83; sql: 47
file content (39 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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>