Yes. Using a Map is very simple and very flexible. There are downsides to it so you need to weigh your options closely. But in the given scenario that you gave a Map would be the best fit. You can use a Map as either a parameter class, a result class or both. The choice is yours. That's the beauty of iBatis. It allows you to decide the best way to implement the solution for your problem without imposing restrictions.


From: "Vinay Singh" <[EMAIL PROTECTED]> [mailto:"Vinay Singh" <[EMAIL PROTECTED]>]
Sent: Friday, June 15, 2007 2:00 PM
To: [EMAIL PROTECTED]
Subject: RE: New to iBatis


So the parameterClass would become java.util.Map?


>From: [EMAIL PROTECTED]
>To: [email protected], [EMAIL PROTECTED]
>Subject: RE: New to iBatis
>Date: Fri, 15 Jun 2007 12:20:04 -0700
>
>
>
>
>
>
>Yes, you can do that or you can pass in a java.util.Map
>that contains your values. This is probably the simpler.
>
>java.util.Map map = new
>java.util.Hashmap();
>map.put("value1", date1);
>map.put("value2", date2);
>
>
>
>From: vinays84 <[EMAIL PROTECTED]>
>[mailto:vinays84 <[EMAIL PROTECTED]>]
>Sent: Friday, June 15,
>2007 12:12 PM
>To: [email protected]
>Subject: Re:
>New to iBatis
>
>
>
>Just as only a single object can be passed in for the return
>class, can only
>a single object be passed in for a parameter class? Consider
>the query:
>
>SELECT movie_name FROM movies WHERE release_date between
>#value1# AND
>#value2#
>
>Could I pass in two dates as parameters, or
>would I have to create a class
>containing value1 and value2 as properties.
>(this class obviously would be
>created solely for this one query).
>--
>
>View this message in context:
>http://www.nabble.com/New-to-iBatis-tf3922862.html#a11145189
>Sent from the
>iBATIS - User - Java mailing list archive at Nabble.com.
>
>
>
>
>

_________________________________________________________________
Need a break? Find your escape route with Live Search Maps.
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Park&cp=33.832922~-117.915659&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=1118863&encType=1&FORM=MGAC01


Reply via email to