ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Turkenkopf" <dturk...@gmail.com>
Subject Re: Immutable objects in ResultMaps
Date Thu, 04 Dec 2008 02:06:35 GMT
Wow.. I guess I did miss it.  For some reason Google wasn't my friend.  I
could only find people asking for it, and no record of it being given. :)

Thanks,
Dan


On Wed, Dec 3, 2008 at 8:57 PM, Jeff Butler <jeffgbutler@gmail.com> wrote:

> See the release notes for version 2.2.0 - Clinton added support for
> private properties in August 2006! :)
>
> Jeff Butler
>
> On Wed, Dec 3, 2008 at 7:25 PM, Dan Turkenkopf <dturkenk@gmail.com> wrote:
> > Maybe I'm just missing something, but I thought that iBATIS required the
> > objects used in a result map to have declared setters.
> >
> > I was in the process if I could figure out a way to use a builder pattern
> to
> > get immutable objects through iBATOR and was working my way through a
> sample
> > application.
> >
> > To my surprise, when I removed the setters from my domain object,
> everything
> > still seemed to work.
> >
> > Did I miss this functionality being introduced?
> >
> > Thanks,
> > Dan Turkenkopf
> >
> > Here's my domain object:
> >
> > public class Master {
> >
> >     private String id;
> >     private String firstName;
> >     private String lastName;
> >
> >     /**
> >      * @return the firstName
> >      */
> >     public String getFirstName() {
> >         return firstName;
> >     }
> >     /**
> >      * @return the id
> >      */
> >     public String getId() {
> >         return id;
> >     }
> >     /**
> >      * @return the lastName
> >      */
> >     public String getLastName() {
> >         return lastName;
> >     }
> >
> > And here's my SQL Map:
> >
> > <sqlMap namespace="Master">
> >
> >   <!-- Result maps describe the mapping between the columns returned
> >        from a query, and the class properties.  A result map isn't
> >        necessary if the columns (or aliases) match to the properties
> >        exactly. -->
> >   <resultMap id="MasterResult"
> > class="com.techegesis.immutable.domain.Master">
> >     <result property="id" column="lahmanid"/>
> >     <result property="firstName" column="nameFirst"/>
> >     <result property="lastName" column="nameLast"/>
> >   </resultMap>
> >
> >   <!-- Select with no parameters using the result map for Master class.
> -->
> >   <select id="selectAllMasters" resultMap="MasterResult">
> >     select * from MASTER
> >   </select>
> >
> > </sqlMap>
> >
> >
> >
>

Mime
View raw message