ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pere Torrodellas" <ptorrodel...@fihoca.com>
Subject Re: iBATIS strange behaviour
Date Fri, 07 Oct 2005 13:03:59 GMT
Hello,

>Larry Meadors
>Thu, 06 Oct 2005 07:37:53 -0700
>
>Hmm, this seems really odd. The code that is in SVN now supports
>properties named like "sProperty" with mutators like "getsProperty"
>and "setsProperty".
>
>According to the beans specification, getters named "getSProperty" and
>"setSProperty" define a property named "SProperty", not "sProperty" as
>you might expect. (BTW, the iBATIS in SVN does that, too).

Well, this is really odd. I checked the spacification and I found out in
horror that it seems inconsistent:

1 - In "8.3.1 Simple properties" it says:

"If we discover a matching pair of "get<PropertyName>" and
"set<PropertyName>" methods that take and return the same type, then we
regard these methods as defining a read-write property whose name will be
"<propertyName>"

This has always been my understanding, and nothing at all is said about a
special case when property names start with lowercase-uppercase.

2 - Much later in "8.8 Capitalization of inferred names" it says:

"Thus when we extract a property or event name from the middle of an
existing Java name, we normally convert the first character to lower case.
However to support the occasional use of all upper-case names, we check if
the first two characters of the name are both upper case and if so leave it
alone. So for example, "FooBah" becomes "fooBah" "Z"" becomes "z" "URL"
becomes "URL".

This is in accordance with your remark, but it's not only contradictory with
8.3.1 above, but what's worse: it leaves in a limbo properties that start
with lowercase-uppercase: what's the setter for "iIdOferta" then ????

Note that the very popular Eclipse IDE (v3.0) builds "setIIdoferta" when
asked to create the setter for attribute "iIdOferta"!!

>OK, I answered the first two questions...someone else gets the last one.
;-)
>
>Two questions for you:
> - How are your getter/setter methods named?

As I said above, Eclipse built the accessosrs getIIdOferta and setIIdOferta.

> - What version of iBATIS are you using?

2.1.5

>Larry

Regards,

Pere


Mime
View raw message