2014-05-09 9:23 GMT+02:00 Paulo Lopes <
pml...@gmail.com>:
>
>
> On Thursday, May 8, 2014 10:22:22 PM UTC+2, Guy Rouillier wrote:
>>
>> The OP didn't mention what DBMS he is using. Oracle, for example, has
>> an nvl function that will allow you to specify an alternative value if
>> the passed argument is null. That way you won't have to case each value
>> column.
Are you try to use a custom typehandler ?
I don't like to use them for business logic but it's an option.
I prefer to format input/output data in domain classes
Regards
>
>
> I've tryed the nvl but i can't use default as the value since default is a
> keyword and the function expects a value...
>
>>
>>
>> On 5/8/2014 3:49 PM, Larry Meadors wrote:
>> > Back in the bad old days, nullValue was actually the opposite of what
>> > you wanted - it mapped null db values to magic Java values.
>> >
>> > Your <case> option may be the simplest way.
>> >
>> > Larry
>> >
>> >
>> > PS: I used to use Maps a LOT for parameters and results...I don't
>> > recommend it. It tends to make things very very difficult to refactor.
>> > It's quick to crank out code like this, but maintenance gets very
>> > costly. YMMV. :)
>> >
>>
>>
>> --
>> Guy Rouillier
>>
>> ---
>> This email is free from viruses and malware because avast! Antivirus
>> protection is active.
>>
http://www.avast.com
>>