ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Jenkins <krisajenk...@yahoo.co.uk>
Subject Re: No readable/writeable property where one exists
Date Tue, 01 Feb 2005 10:36:09 GMT
Mark,

This one comes up a lot.  I've put it in the FAQ:

http://wiki.apache.org/ibatis/Why_20can_27t_20I_20use_20a_20property_20that_20begins_20with_20a_20single_20lower_2dcase_20letter_3f#preview

HTH,
Kris

>Guys,
>
>There is a problem in ClassInfo.dropCase( String name ) method.
>
>When i have a property with a name starting with a single lowercase letter - the resulting
property name is capitalised...
>
>For example we have a field "cRoid" with a getter getCRoid() and setter setCRoid( Long
cRoid )
>
>When we try to have a query of the form
>			select *	from CLI_CLIENTS where C_ROID = #cRoid#
>we get a 
>	There is no READABLE property named 'cRoid' in class ...
>
>And when we use it as a result such as
>	<result property="cRoid" column="C_ROID"/>
>we get a 
>	There is no WRITEABLE property named 'cRoid' in class ...
>
>To make it work I need to reference it as 'CRoid' in the XML - making it inconsistent.

>
>The problem is the logic in the dropCase method doesnt make the first letter lower case
if the second letter is upper case.
>(I suppose this is to catch properties that start with an acronym - eg getSQLConnection;
would be SQLConnection ?!)
>
>I think the Java standard would still prefer the see these properties start with a lower
case letter.
>Or Maybe we need someway to override this default behaviour ? 
>
>Anyway,
>any feed back would be appreciated.
>
>I think I am going to have to change this class for our installation as I don't want people
having to remember to treat some properties differently when writing queries.
>
>
>regards,
>Mark Ralph
>
>
>
>
>  
>


-- 
Kris Jenkins
Email:  kris@jenkster.com
Blog:   http://cafe.jenkster.com/
Wiki:   http://wiki.jenkster.com/


Mime
View raw message