zyoung88
zyoung88
2009-04-03 12:50

ibatis的官方示例请教

  • ibatis

JPetStore5.0的示例  这样的写法有什么好处?SQL语句执行的几遍? 本人新手望各位大侠详细解答  小弟谢谢了

<typeAlias alias="account" type="com.ibatis.jpetstore.domain.Account"/>

  <select id="getAccountByUsername" resultClass="account" parameterClass="string">
    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
  </select>

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐