阅读更多
简单起见,拿JPetStore5.0来举例吧.
在配置文件sql-map-config.xml中,他是这么写的
其他是transactionManager的配置就不管了.
这里的Account.xml是不是就是分模块的配置文件?我猜想应该是的吧
再问问Account.xml里面的一些东西
SELECT
SIGNON.USERNAME,
ACCOUNT.EMAIL,
ACCOUNT.FIRSTNAME,
ACCOUNT.LASTNAME,
ACCOUNT.STATUS,
ACCOUNT.ADDR1 AS address1,
ACCOUNT.ADDR2 AS address2,
ACCOUNT.CITY,
ACCOUNT.STATE,
ACCOUNT.ZIP,
ACCOUNT.COUNTRY,
ACCOUNT.PHONE,
PROFILE.LANGPREF AS languagePreference,
PROFILE.FAVCATEGORY AS favouriteCategoryId,
PROFILE.MYLISTOPT AS listOption,
PROFILE.BANNEROPT AS bannerOption,
BANNERDATA.BANNERNAME
FROM ACCOUNT, PROFILE, SIGNON, BANNERDATA
WHERE ACCOUNT.USERID = #username#
AND SIGNON.USERNAME = ACCOUNT.USERID
AND PROFILE.USERID = ACCOUNT.USERID
AND PROFILE.FAVCATEGORY = BANNERDATA.FAVCATEGORY
我知道iBatis并没有hibernate那样,显示的对应column和field的对应关系.
就拿上面的select语句来说, iBatis怎么知道, SIGNON.USERNAME 这个东西对应哪个字段呢?