Jeff Bowes, Xenbase, University of Calgary. This Wiki section is an edited version of Jeff’s presentation.
<abatorConfiguration>
<abatorContext> <!-- TODO: Add Database Connection Information -->
<jdbcConnection driverClass="COM.ibm.db2.jdbc.app.DB2Driver"
connectionURL="jdbc:db2:XBDV05"
userId="db2inst1"
password=“*******">
<classPathEntry location="/Program Files/IBM/SQLLIB/java/db2java.zip" />
</jdbcConnection>
<javaModelGenerator
targetPackage="org.gmod.architecture.framwork.bakeoff.abator.model"
targetProject="gene" />
<sqlMapGenerator
targetPackage="org.gmod.architecture.framwork.bakeoff.abator.sql"
targetProject="gene" />
<daoGenerator type="IBATIS"
targetPackage="org.gmod.architecture.framwork.bakeoff.abator.dao"
targetProject="gene" />
<abatorConfiguration>
<abatorConfiguration>
<abatorContext> <!-- TODO: Add Database Connection Information -->
<jdbcConnection driverClass="COM.ibm.db2.jdbc.app.DB2Driver"
connectionURL="jdbc:db2:XBDV05"
userId="db2inst1"
password=“*******">
<classPathEntry location="/Program Files/IBM/SQLLIB/java/db2java.zip" />
</jdbcConnection>
<javaModelGenerator
targetPackage="org.gmod.architecture.framwork.bakeoff.abator.model"
targetProject="gene" />
<sqlMapGenerator
targetPackage="org.gmod.architecture.framwork.bakeoff.abator.sql"
targetProject="gene" />
<daoGenerator type="IBATIS"
targetPackage="org.gmod.architecture.framwork.bakeoff.abator.dao"
targetProject="gene" />
<abatorConfiguration>
<table schema="db2inst1" tableName="synonym"></nowiki>
<generatedKey column="synonym_id" sqlStatement="VALUES PREVVAL FOR
synonym_seq" identity="true" />
<columnOverride column="CREATED_BY" jdbcType="INTEGER" />
<columnOverride column="MODIFIED_BY" jdbcType="INTEGER" />
</table>
Works as:
<insert id="abatorgenerated_insert" parameterClass=
"org.gmod.architecture.framwork.bakeoff.abator.model.FeatureWithBLOBs">
insert into db2inst1.feature
(DBXREF_ID, ORGANISM_ID, NAME, UNIQUENAME,
RESIDUES, SEQLEN, MD5CHECKSUM, TYPE_ID, IS_ANALYSIS,
IS_OBSOLETE, CREATED_BY)
values (#dbxrefId:INTEGER#, #organismId:INTEGER#, #name:VARCHAR#,
#uniquename:VARCHAR#, #residues:CLOB#, #seqlen:INTEGER#,
#md5checksum:CHAR#, #typeId:INTEGER#,
#isAnalysis:SMALLINT#, #isObsolete:SMALLINT#,
#createdBy:INTEGER#)
<selectKey resultClass="java.lang.Integer" keyProperty="featureId">
VALUES PREVVAL FOR feature_seq
</selectKey>
</insert>
<insert id="abatorgenerated_insert" parameterClass=
"org.gmod.architecture.framwork.bakeoff.abator.model.FeatureWithBLOBs">
insert into db2inst1.feature
(DBXREF_ID, ORGANISM_ID, NAME, UNIQUENAME,
RESIDUES, SEQLEN, MD5CHECKSUM, TYPE_ID, IS_ANALYSIS,
IS_OBSOLETE, CREATED_BY)
values (#dbxrefId:INTEGER#, #organismId:INTEGER#, #name:VARCHAR#,
#uniquename:VARCHAR#, #residues:CLOB#, #seqlen:INTEGER#,
#md5checksum:CHAR#, #typeId:INTEGER#,
#isAnalysis:SMALLINT#, #isObsolete:SMALLINT#,
#createdBy:INTEGER#)
<selectKey resultClass="java.lang.Integer" keyProperty="featureId">
VALUES PREVVAL FOR feature_seq
</selectKey>
</insert>
<insert id="abatorgenerated_insert" parameterClass=
"org.gmod.architecture.framwork.bakeoff.abator.model.FeatureWithBLOBs">
insert into db2inst1.feature
(DBXREF_ID, ORGANISM_ID, NAME, UNIQUENAME,
RESIDUES, SEQLEN, MD5CHECKSUM, TYPE_ID, IS_ANALYSIS,
IS_OBSOLETE, CREATED_BY)
values (#dbxrefId:INTEGER#, #organismId:INTEGER#, #name:VARCHAR#,
#uniquename:VARCHAR#, #residues:CLOB#, #seqlen:INTEGER#,
#md5checksum:CHAR#, #typeId:INTEGER#,
#isAnalysis:SMALLINT#, #isObsolete:SMALLINT#,
#createdBy:INTEGER#)
<selectKey resultClass="java.lang.Integer" keyProperty="featureId">
VALUES PREVVAL FOR feature_seq
</selectKey>
</insert>
<selectKey resultClass="java.lang.Integer"
keyProperty="featureId">
VALUES PREVVAL FOR feature_seq
</selectKey>
<selectKey resultClass="java.lang.Integer"
keyProperty="featureId">
VALUES PREVVAL FOR feature_seq
</selectKey>
try {
sqlMap.startTransaction();
pGene.id =featureDAO.insert(pGene.getFeatureWithBLOBs());
featurepropDAO.insert(pGene.getPropertyDescription());
pGene.featurelocId = featurelocDAO.insert(pGene
.getFeaturelocWithBLOBS());
pGene = insertExons(pGene);
insertSynonyms(pGene);
sqlMap.commitTransaction();
} catch (Exception e) {
System.out.println(e);
throw (e);
} finally {
sqlMap.endTransaction();
}
try {
sqlMap.startTransaction();
pGene.id =featureDAO.insert(pGene.getFeatureWithBLOBs());
featurepropDAO.insert(pGene.getPropertyDescription());
pGene.featurelocId = featurelocDAO.insert(pGene
.getFeaturelocWithBLOBS());
pGene = insertExons(pGene);
insertSynonyms(pGene);
sqlMap.commitTransaction();
} catch (Exception e) {
System.out.println(e);
throw (e);
} finally {
sqlMap.endTransaction();
}
symbol: xfile
description: A test gene for GMOD meeting
mRNA Feature
exon_1: start: 13691 end: 13767
strand: 1
srcFeature_id: Id of genomic sample
exon_2: start: 14687 end: 14720
strand: 1
srcFeature_id: Id of genomic sample
Account for cycles or recursion in Master Detail Report.
<resultMap id="SelectGeneResults"
class="org.gmod.architecture.framwork.bakeoff.Gene" groupBy="id">
<result column="FEATURE_ID" property="id" jdbcType="INTEGER"/>
<result column="GENE_NAME" property="name" jdbcType="VARCHAR" />
<result column="DESCRIPTION" property="description“
jdbcType="VARCHAR" />
<result column="TYPE_ID" property="typeId" jdbcType="INTEGER" />
<result property="exons" resultMap = "gene.SelectExonResults"/>
</resultMap>
<resultMap id="SelectExonResults"
class="org.gmod.architecture.framwork.bakeoff.Exon">
<result column="EXON_ID" property="id" jdbcType="INTEGER"/>
<result column="EXON_NAME" property="name" jdbcType="VARCHAR" />
<result column="EXON_RESIDUES" property="residues" jdbcType="CLOB" />
<result column="STRAND" property="strand" jdbcType="INTEGER" />
<result column="FMIN" property="fmin" jdbcType="INTEGER" />
<result column="FMAX" property="fmax" jdbcType="INTEGER" />
<result column="SRCFEATURE_ID" property="sourceFeatureId"
jdbcType="INTEGER" />
</resultMap>
<resultMap id="SelectGeneResults"
class="org.gmod.architecture.framwork.bakeoff.Gene" groupBy="id">
<result column="FEATURE_ID" property="id" jdbcType="INTEGER"/>
<result column="GENE_NAME" property="name" jdbcType="VARCHAR" />
<result column="DESCRIPTION" property="description“
jdbcType="VARCHAR" />
<result column="TYPE_ID" property="typeId" jdbcType="INTEGER" />
<result property="exons" resultMap = "gene.SelectExonResults"/>
</resultMap>
<resultMap id="SelectExonResults"
class="org.gmod.architecture.framwork.bakeoff.Exon">
<result column="EXON_ID" property="id" jdbcType="INTEGER"/>
<result column="EXON_NAME" property="name" jdbcType="VARCHAR" />
<result column="EXON_RESIDUES" property="residues" jdbcType="CLOB" />
<result column="STRAND" property="strand" jdbcType="INTEGER" />
<result column="FMIN" property="fmin" jdbcType="INTEGER" />
<result column="FMAX" property="fmax" jdbcType="INTEGER" />
<result column="SRCFEATURE_ID" property="sourceFeatureId"
jdbcType="INTEGER" />
</resultMap>
gene_id Symbol Type Fmin Fmax
6129482 x-files gene 13691 13767
6129482 x-files gene 14687 14720
Becomes:
gene_id Symbol Type Fmin Fmax
6129482 x-files gene 13691 13767
14687 14720
FROM
CAT_X_GENE_V gc
<isEqual
prepend=",property="searchSymbol"
compareValue="true">
GENE_SYMBOLS s
</isEqual>
<isEqual prepend=","
property="searchNcbi"
compareValue="true">
NCBI_GI n
</isEqual>
<dynamic prepend="WHERE">
<isEqual prepend="AND" property="searchNameOnly“
compareValue="true">
<iterate property="searchTokens" conjunction="AND"
open=" (" close=") ">
LOWER(VARCHAR(gc.longname)) LIKE
LOWER(CAST(#searchTokens[]:VARCHAR# AS VARCHAR(512)))
</iterate>
</isEqual>
Iterate very useful for multiple search terms
GMOD
Ibatis Developers
PI
Financial Support