On Tuesday, April 29, 2014 12:21:49 AM UTC-7, Lukas Eder wrote:
>
> ...
>
>> I would even go so far as to consider it bugs that the strategies require 
>> that "get" and "set" be provided in the output of <fieldSetter> and 
>> <fieldGetter>; and that the transform is applied to the "get" and "set" 
>> suffixes as well.
>>
>
> How would you go about people not wanting "get" and "set" in their getter 
> and setter names?
>

Um... er... as they say in Brazil, "estou sem palavras"---I'm without 
words. Speechless. hehe At first I thought you were joking. I mean, if the 
number of people using "foo:bar" and "foo#bar" in the same table is like 
.1% of users, a use who doesn't want "get" in the getter name (is it still 
a getter, then?) is like .05% of users. (Numbers used for explanatory 
value, not for accuracy.)

But this is very easily addressed, and at the same time addresses another 
issue I raised, namely that you shouldn't have to define both getters and 
setters when you know the general format of the property. jOOQ should add a 
property named <fieldProperty>. If defined, it determines what comes after 
both "get" and "set" in getters and setters, respectively. That is, if I 
set the <fieldProperty> transform to UPPER, then this produces getFOO() and 
setFOO() and I don't even have to define <fieldGetter> and <fieldSetter>. 
For that tiny fraction of people who don't even want "get" and "set" in 
their accessor names, then they can define <fieldGetter> and/or 
<fieldSetter>, which will override the rule in <fieldProperty> (or they 
don't even have to define <fieldProperty> at all). This solution therefore 
is even 100% backwards compatible. If you add it in the next version, no 
one even has to change their code if they want to continue using 
<fieldGetter> and/or <fieldSetter>!

See, the general rule should be, "make the default configuration work as 
expected for the 99.98% of normal use cases, and provide optional 
configuration for the .01% of users who want to break convention".
 

>  
>
>> OK, I'll use what I got sort of working. But can someone tell me what 
>> <fieldMember> applies to?
>>
>
> It is used for member names in POJOs and also for method argument names.
>

Maybe you could point me to an example? I guess I haven't got to POJOs 
yet---I was thinking the ExampleRecord class was like a POJO.

Anyway, Lukas, thanks so much for all your help and feedback on this. I've 
got jOOQ set up in our project now, and I've handed the database access 
part over to a teammate to convert some of our existing SQL to jOOQ. We'll 
see how it goes.

Thanks again!

Garret

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to