You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Amad Fida <am...@yahoo.com> on 2006/11/10 11:54:20 UTC
Simple question
All - I have a POJO which has a collection property as,
public class User {
private List<String> customProperties;
public List<String> getCustomProperties() {
return customProperties;
}
public void setCustomProperties( List<String> customProperties) {
customProperties = customProperties;
}
}
In My table i have columns as
CUSTOMPROPERTY1, CUSTOMPROEPRTY2, ...... CUSTOMPROEPRTY20
How to i map these individual columns to collection property in my resultMap?
Note: There are other properties of user which i omitted for simplicity.
Thanks
Amad
----- Original Message ----
From: Jeff Butler <je...@gmail.com>
To: user-java@ibatis.apache.org
Sent: Thursday, November 9, 2006 8:30:13 PM
Subject: Re: iBATIS DAO
The DAO user's guide is on the Java downloads page. But we are deprecating the DAO framework. If you're not using it now, don't start. Use Spring, or just use the SqlMap API.
Jeff Butler
On 11/9/06, Hari... <ha...@gmail.com> wrote:
can someone plese send me some links where i can get the tutorial and
examples for Dao
I searched in net i am getting ex for the sql map not for dao
--
View this message in context: http://www.nabble.com/iBATIS-DAO-tf2605663.html#a7270869
Sent from the iBATIS - User - Java mailing list archive at
Nabble.com.
Re: Simple question
Posted by Koka Kiknadze <22...@gmail.com>.
Seems the only way would be to write custom rowhanlder.
However, I'd change design of database to match java object, i.e. would have
separated CUSTOMPROPERTY-ies into a separate table. In that case you'd be
able to populate the list along the lines described in dev guide.
On the other hand iIf you think that there always would be fixed number of
CUSTOMPROPERTY-ies and feel more comfortable with current database design,
why not make your POJO the same way, i.e. use separate properties for each
CUSTOMPROPERTY instead of the list?
On 11/10/06, Amad Fida <am...@yahoo.com> wrote:
>
> All - I have a POJO which has a collection property as,
>
> public class User {
> private List<String> customProperties;
>
> public List<String> getCustomProperties() {
> return customProperties;
> }
>
> public void setCustomProperties( List<String> customProperties) {
> customProperties = customProperties;
> }
>
> }
>
>
> In My table i have columns as
>
> CUSTOMPROPERTY1, CUSTOMPROEPRTY2, ...... CUSTOMPROEPRTY20
>
> How to i map these individual columns to collection property in my
> resultMap?
>
> Note: There are other properties of user which i omitted for simplicity.
>
> Thanks
>
> Amad
>
> ----- Original Message ----
> From: Jeff Butler <je...@gmail.com>
> To: user-java@ibatis.apache.org
> Sent: Thursday, November 9, 2006 8:30:13 PM
> Subject: Re: iBATIS DAO
>
> The DAO user's guide is on the Java downloads page. But we are
> deprecating the DAO framework. If you're not using it now, don't start.
> Use Spring, or just use the SqlMap API.
>
> Jeff Butler
>
>
>
> On 11/9/06, Hari... <ha...@gmail.com> wrote:
> >
> >
> > can someone plese send me some links where i can get the tutorial and
> > examples for Dao
> > I searched in net i am getting ex for the sql map not for dao
> > --
> > View this message in context:
> > http://www.nabble.com/iBATIS-DAO-tf2605663.html#a7270869
> > Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >
> >
>
>
>