ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance Java" <lance.j...@googlemail.com>
Subject Re: Changing the default column --> property name mapping
Date Wed, 06 Aug 2008 15:18:48 GMT
Yep, that's what I'm after.
A more generic solution would be to provide a mapper in the ibatis config
with:
   getPropertyName(Class typeToPopulate, String columnName)

Jason, thanks for the response but I'm looking for something less verbose
and easier to maintain.

On 06/08/2008, Michael Schall <mike.schall@gmail.com> wrote:
>
> Lance -
>
> I'm pretty sure this is only a proposed feature for 3.0.  Jason's example
> is the only way of mapping columns to properties that I'm aware of in 2.x.
>
>
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/iBATIS+3.0+Whiteboard#iBATIS3.0Whiteboard-SomePossibleConfigurationOptions
>
> Mike
>
> On Wed, Aug 6, 2008 at 9:57 AM, Jason Kratz <jason.kratz@firm58.com>wrote:
>
>> Not sure I understand you.  This is exactly how a resultMap works (and
>> core to iBATIS)
>>
>>  <resultMap id="getPaymentResult" class="payment">
>> <result property="paymentId" column="PAYMENT_IDI"/>
>> ....
>>
>>
>>
>>  On Aug 6, 2008, at 9:39 AM, Lance Java wrote:
>>
>>  I would like to change the default column --> property name mapping
>> functionality.
>> eg in my db, column names are of the form "column_name" whereas properties
>> are of the form "columnName"
>>
>> I have read through the documentation and there is no mention of providing
>> my own column --> property name mapper.
>>
>> I realise that I can use "select column_name AS columnName" but this does
>> not work for "select *" or stored procedures etc.
>>
>>
>> Cheers,
>> Lance.
>>
>>
>>
>>
>
>

Mime
View raw message