ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pc leung <pingcheu...@gmail.com>
Subject How to define xml of queryForObject and queryForList?
Date Tue, 29 Nov 2005 15:39:26 GMT
How to define xml of queryForObject and queryForList?

UserProfileSqlMapDao.java:
...
	public UserProfile getUserProfile(String usernm) {
		return (UserProfile)super.queryForObject("getUserProfile", usernm);
	}
	
	public List getUserProfileList(String usernm) {
		return super.queryForList("getUserProfileList", usernm);
	}
...

UserProfile.xml:
...
  <select id="getUserProfile" parameterClass="string"
resultMap="userProfileResult">
    select usernm, passwd, eng_name, chi_name, dob, join_date,
           creation_date, created_by, last_update_date, last_update_by
      from user_profile
     where usernm = #usernm#
  </select>

  <select id="getUserProfileList" parameterClass="string"
resultMap="userProfileResult">
    select usernm, passwd, eng_name, chi_name, dob, join_date,
           creation_date, created_by, last_update_date, last_update_by
      from user_profile
     where usernm = #usernm#
  </select>
...

Mime
View raw message