ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: Ibatis 3 - special method in model class which Ibatis can't use
Date Tue, 13 Apr 2010 21:04:11 GMT
I've got a fix for this - I'll commit shortly.

Jeff Butler


On Tue, Apr 13, 2010 at 3:34 PM, Jeff Butler <jeffgbutler@gmail.com> wrote:
> I just confirmed this to be true.  It has nothing to do with Ibator.
>
> Clinton - the constructor for DynamicContext calls every "getter" in
> the parameter object regardless of whether it is used in the query or
> not.    I suppose we should take a look at changing this somehow.
>
> Jeff Butler
>
>
> 2010/4/13 Tomáš Procházka <t.prochazka@centrum.cz>:
>>
>> Hi.
>>
>>
>> Simply add method like
>>
>> private String something;
>>
>> public String getSomething() {
>>  System.out.println("Call getSomething");
>>  return something;
>> }
>>
>> to some model class which was generated by IBATOR without any modification of mapping
xml.
>>
>> And try do some update or inserts with this model class like
>>
>> QueueMapper qm = s.getMapper(QueueMapper.class);
>> qm.updateByPrimaryKeySelective(q);
>>
>> ______________________________________________________________
>>> Od: "Clinton Begin" <clinton.begin@gmail.com>
>>> Komu: user-java@ibatis.apache.org, Tomáš Procházka <t.prochazka@centrum.cz>
>>> Datum: 12.04.2010 17:18
>>> Předmět: Re: Ibatis 3 - special method in model class which Ibatis can't use
>>>
>>>Example?
>>>
>>>2010/4/12 Tomáš Procházka <t.prochazka@centrum.cz>
>>>
>>>> Hi.
>>>>
>>>> I found some problem. I need have special method in model class which do
>>>> some lazy initialization which can't be called from iBatis mapper. But
>>>> problem is, that iBatis call all getXyz methods during insert or updated,
>>>> also if I don't specify this fields in mapper xml file. I think that he call
>>>> all get methods.
>>>>
>>>> Don't be better call only methods which is used in mapper XML file?
>>>>
>>>> Or exist some annotation which tell Ibatis don't use some method?
>>>>
>>>> I also tried move these methods to parent abstract class. So it is not
>>>> defined in model class directly, but Ibatis still call them during insert
or
>>>> update.
>>>>
>>>> Do you somebody have some idea?
>>>>
>>>>
>>>> Datum: 8:00:11    12. dubna 2010
>>>> --
>>>> ---------------------------------------------------------------------
>>>>  Tomáš Procházka
>>>>
>>>>
>>>>  E-mail: t.prochazka@centrum.cz
>>>>    WWW: http://www.atomsoft.cz
>>>>    ICQ: 87147320
>>>> ---------------------------------------------------------------------
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>>>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message