ibatis-2.3.4.726学习(二) 多表关联查询(Ibatis-2.3.4.726 learning (two) multi table Association query).docVIP
- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ibatis-2.3.4.726学习(二) 多表关联查询(Ibatis-2.3.4.726 learning (two) multi table Association query)
ibatis-26学习(二) 多表关联查询(Ibatis-26 learning (two) multi table Association query)
Here in table lock and key as an example, a lock can be equipped with more than one key, one key can only correspond to a lock.
The database table
Create table (lock
ID int,
LockName varchar
);
Create table (key
ID int,
LockId int,
KeyName varchar
);
The definition of mapping class:
Public class {Key
Private int id;
Private int lockId;
Private String keyName;
Private Lock lock;
Public int (getId) {
Return id;
}
Public void setId (int ID) {
This.id = id;
}
Public int (getLockId) {
Return lockId;
}
Public void setLockId (int lockId) {
This.lockId = lockId;
}
Public String (getKeyName) {
Return keyName;
}
Public void setKeyName (String keyName) {
This.keyName = keyName;
}
Public Lock (getLock) {
Return lock;
}
Public void setLock (Lock lock) {
This.lock = lock;
}
}
Public class {Lock
Private int id;
Private String lockName;
Private ListKey keys;
Public int (getId) {
Return id;
}
Public void setId (int ID) {
This.id = id;
}
Public String (getLockName) {
Return lockName;
}
Public void setLockName (String lockName) {
This.lockName = lockName;
}
Public ListKey (getKeys) {
Return keys;
}
Public void setKeys (ListKey keys) {
This.keys = keys;
}
}
Configure the ibatis SqlMapping file
? XML version= 1 encoding= UTF-8 ?
DOCTYPE sqlMap -////DTD! PUBLIC SQL Map 2.0//EN
Http:///dtd/sql-map-2.dtd
sqlMap namespace= lock
typeAlias alias= Key type= com.longsky.ibatis.lock.model.Key /
typeAlias alias= Lock type= com.longsky.ibatis.lock.model.Lock /
resultMap id= KeyResult class= Key
result property= Id column= Id /
result property= keyName column= keyName /
result property= lock column= lockId select= getLockById /
/resultMap
! -- by save the key table in the lock ID of association, ibatis will use the getLockById (lockId) the results of filling the lock attribute --
resultMap id= LockResult class= Lock
result property= Id column= Id /
result property= lockName column= lockName /
result property=
您可能关注的文档
- eja智能压力变送器(EJA intelligent pressure transmitter).doc
- doto装备出法(Doto equipment out of law).doc
- emcos.antenna.vlab.v1.01.student.version天线仿真计算(该天线。VLAB。V1.01版本天线仿真计算。的学生。).doc
- encrypt(加密).doc
- epi 琴鉴定(EPI琴鉴定).doc
- english around the world 词汇解析(世界各地的词汇解析英语).doc
- epr悖论(epr悖论).doc
- em菌的应用与配制(Application and preparation of EM bacteria).doc
- eps环境下地形要素符号的绘制方法--王金诚-20110620--完整版(EPS environment mapping symbols of terrain elements - Wang Jincheng -20110620-- full version).doc
- eq调节简单介绍(Brief introduction to EQ regulation).doc
- ibm bios设置(IBM BIOS settings).doc
- ibm t22 bios设置(IBM T22 BIOS settings).doc
- hx8089详细资料简介(Hx8089 details).doc
- icu 护理 临床论文选题题目参考(ICU nursing clinical papers topic selection reference).doc
- ic规范摘要(IC specification summary).doc
- ie中隐藏显示div中的flash不会重新播放(Hidden in IE shows that the div in flash will not be replayed).doc
- ie工业工程实战(Ie industrial engineering practice).doc
- ie图标丢失(Ie icon missing).doc
- ie百科--稼动率(Ie - utilization rate).doc
- iic总线读写程序(IIC bus read and write program).doc
文档评论(0)