ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric T. Blue" <ericblu...@gmail.com>
Subject Re: A couple of questions
Date Wed, 29 Mar 2006 22:47:18 GMT
Tony,

Try aliasing the duplicate columns.  For example:

Select a.column1 as a_column1, b.column1 as b_column1 from table1 a, table2
b
where b.some_id = a.id

On 3/29/06, Tony Qian <daqiqian2@aol.com> wrote:
>
> All,
>
> Got two questions on iBATIS DAO.
>
> 1) I have two tables.  Those two tables happen to have a column with same
> name.  I try to join those two table first and then use groupBy to construct
> two lists, one for each table. The problem is that I cannot use table
> qualifier to specify the data from a particular table, such as
> C.expiration_date and S.expiration_date.
>
> <resultMap id="savingCardMap" class="MemberSavingCard"
> groupBy="savingCardId">
>           <result property="savingCardId" column="saving_card_id" />
>           <result property="expirationDate" column="S.expiration_date"
> />    // expiration_date from saving_card table
>   </resultMap>
>
>   <resultMap id="couponToInforteMap" class="Coupon" groupBy="couponId">
>           <result property="couponId" column="coupon_id" />
>           <result property="expirationDate" column="C.expiration_date" />
> // expiration_date from coupon table
>   </resultMap>
>
> select
>          C.coupon_id,
>          C.expiration_date,
>          S.saving_card_id,
>          S.expiration_date
> from coupon as C, saving_card as S where ....
>
> 2) if we use SqlMapClient, we can do batch transaction. Does DaoManager
> support batch transaction similar to SqlMapClient? If not, is there other
> way to do batch?
>
> thanks,
> Tony
>
>

Mime
View raw message