ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bolinger, Gregg D" <Gregg.Bolin...@intrustbank.com>
Subject RE: Mapping Complex Properties (Load all properties)
Date Thu, 06 Jan 2005 21:11:48 GMT
Basically I need to run a query similar to 

SELECT i.*, u.* from t_issue i LEFT JOIN t_user u ON i.creating_user_id
= u.user_id WHERE i.issue_id = 20

And have Issue and User populated with their relavent properties.

Gregg

-----Original Message-----
From: Bolinger, Gregg D [mailto:Gregg.Bolinger@intrustbank.com] 
Sent: Thursday, January 06, 2005 3:08 PM
To: ibatis-user-java@incubator.apache.org; Brandon Goodin
Subject: RE: Mapping Complex Properties (Load all properties)

I did read those pages. Over and over.  And my very first example was
identical to what was on those pages.  Those pages show that Category
has multiple columns in the Product table.  I have 1 column in my Issue
table referring to User and I need to fill the entire User object.

Gregg

-----Original Message-----
From: Brandon Goodin [mailto:brandon.goodin@gmail.com] 
Sent: Thursday, January 06, 2005 3:06 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: Mapping Complex Properties (Load all properties)

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