File: CvTerm.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 (75 lines) | stat: -rw-r--r-- 2,781 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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="CvTerm"> 

    <cacheModel id="cvterm-cache" type ="LRU" readOnly="true"> 
      <flushInterval hours="24"/>  
      <property name="cache-size" value="100" /> 
    </cacheModel> 
    
    <typeAlias alias="CvTerm"
        type="org.gmod.schema.cv.CvTerm"/>
 
    <resultMap id="select-cvterm-names-result" class="CvTerm">
   	  <result property="cvTermId" column="cvterm_id"/>
      <result property="cv.cvId" column="cv_id"/>
   	  <result property="cv.name" column="cv_name"/>
  	  <result property="name" column="name"/>
      <result property="definition" column="definition"/>
      <result property="dbXRef" column="dbxref_id" select="getDbXRefByDbXRefId"/>
      <result property="isObsolete" column="is_obsolete"/>
      <result property="isRelationshipType" column="is_relationshiptype"/>
    </resultMap>
    
    <resultMap id="lazy-cvterm" class="CvTerm">
   	  <result property="cvTermId" column="cvterm_id"/>
   	  <result property="cv" column="cv_id" select="selectCv"/>
  	  <result property="name" column="name"/>
      <result property="definition" column="definition"/>
      <result property="dbXRef" column="dbxref_id" select="getDbXRefByDbXRefId"/>
      <result property="isObsolete" column="is_obsolete"/>
      <result property="isRelationshipType" column="is_relationshiptype"/>
    </resultMap>
    

    <!-- look up cvterms names and id -->
     <select id="getCvterm" resultMap="select-cvterm-names-result"> 
   	SELECT  
	  cvterm.*, cv.name as cv_name
        FROM cvterm, cv
        WHERE 
            <dynamic>
             <isNotNull property="name">
               cvterm.name LIKE #name# AND
             </isNotNull>
             <isNotNull property="cv.name">
               cv.name=#cv.name# AND
             </isNotNull>
			 <isNotNull property="cvTermId">
               <isGreaterThan property="cvTermId" compareValue="0">
                 cvterm_id=$cvTermId$ AND
               </isGreaterThan>
			</isNotNull>
            </dynamic>	
	    cv.cv_id = cvterm.cv_id
     </select> 
     
      <!-- look up cvterms names and id -->
     <select id="getCvtermByCvTermId" 
             resultMap="lazy-cvterm" cacheModel="cvterm-cache"> 
       SELECT *
       FROM cvterm
       WHERE cvterm_id=#value# 
     </select> 

	  <!-- WRITE BACK -->
  <insert id="insertCvTerm" parameterClass="CvTerm">
    INSERT INTO cvterm ( cv_id, name <isNotNull property="definition">, definition</isNotNull>, dbxref_id ) 
           VALUES ($cv.cvId$, #name# <isNotNull property="definition"> ,#definition# </isNotNull>, $dbXRef.dbXRefId$)
  </insert> 
</sqlMap>