ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Collin Peters" <cadio...@gmail.com>
Subject Is it possible to have an optional property in resultMap?
Date Thu, 15 Mar 2007 15:54:08 GMT
Hi everyone,

I'm just wondering if it is possible to have an optional property in a
resultMap?  For example, I have a UserVO class which I use to load
users into.  It has fields such as user_id, username, firstname,
lastname, password, etc...  I also want to use this class as a
'sub'-resultMap from another call.  For example, I have a call called
loadDailySchedule, in this call I grab all events in a schedule, along
with all the participants, and group by the event_id.  So the sqlmap

	<resultMap id="eventResult" class="EventVO" groupBy="eventID">
		<result property="eventID" column="event_id" />
		<result property="summary" column="summary" />
		<result property="participants" resultMap="common.userResult" />

The problem is that I don't want to have to include fields like the
users password in this query as it is not needed.  If I want to use
the common.userResult resultMap (which uses the UserVO class) though,
I need to include those fields otherwise I get the error: "The column
name password was not found in this ResultSet"


View raw message