ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Mapping Complex Properties (Load all properties)
Date Thu, 06 Jan 2005 21:06:18 GMT
You need to read page 25--26 of the SqlMaps Manual.

Brandon


On Thu, 6 Jan 2005 14:59:57 -0600, Bolinger, Gregg D
<Gregg.Bolinger@intrustbank.com> wrote:
> 
> But there aren't other columns for those properties.  Let me explain...
> Here is some test code.  T_user and t_issue are tables in a database.
> Below that are 2 java files.  This is pseudo code and outlook keeps
> correctly cap mistakes so don't poke fun at the bad syntax. :)
> 
> t_user
> ------
> User_id
> First_name
> Last_name
> 
> T_issue
> --------
> Issue_id
> User_id
> 
> Issue.java
> ----------
> Public class Issue
> {
>         Private int issueId;
>         Private User user;
>         //getters and setters
> }
> 
> User.java
> -----------
> Public class User
> {
>         Private int userId;
>         Private int firstName;
>         Private int lastName;
>         //getters and setters
> }
> 
> When I query for an Issue and return an Issue.java object, I need User
> to be populated with the appropriate user for that issue.  Does that
> make more sense?
> 
> Gregg
> 
> -----Original Message-----
> From: Larry Meadors [mailto:larry.meadors@gmail.com]
> Sent: Thursday, January 06, 2005 2:08 PM
> To: Bolinger, Gregg D
> Subject: Re: Mapping Complex Properties (Load all properties)
> 
> Well, I would assume you'd map other columns to those properties, but
> yeah, you have the idea. :-)
> 
> Larry
> 
> On Thu, 6 Jan 2005 14:01:04 -0600, Bolinger, Gregg D
> <Gregg.Bolinger@intrustbank.com> wrote:
> > I assume you mean:
> >
> > <result property="createdByUser.userId" column="creating_user_id" />
> >
> > Well, would I map my other properties lke
> >
> > <result property="createdByUser.firstName" column="creating_user_id"
> />
> > <result property="createdByUser.lastName" column="creating_user_id" />
> 
>

Mime
View raw message