Yes I agree. My properties *were* myProperty format, not MyProperty - as
Abator generates them.

The problem I've found, is that for *every* table in my dB that contains a
column name of the pattern x_yyyy...  (ie. where the first letter is
lowercase and followed by an underscore), iBatis fails, complaining as per
below that no property exists called xYyyy... It kicks a fit around looking
for the setter method.

What I was showing, was that a work around, is to override the property name
to XYyyy... Then iBatis stops complaining. 

Further note: 
Same problem with column name:
L_state
l_State
L_State

problem fixed with column name:
ll_state

Just to be clear - simply changing the column name from l_state to ll_state
in my db and re-generating the abator artefacts fixes the problem. But I
don't want to change my scheme, and the work arounds below do seem to work
for now, but this does seem to be a problem.


Daniel Pitts wrote:
> 
> Its my understanding that you're property name should start with a
> lowercass letter, not an uppercase letter.
> getMyProperty() will get the "myProperty" property.  There is no
> "MyProperty", and no way to create one, short of implementing a BeanInfo
> class.  Who wants to do that? And I don't think iBATIS supports standard
> bean introspection, so a BeanInfo class isn't going to help in this
> case.
> 
> 
> ________________________________
> 
>       From: Antony Stubbs [mailto:[EMAIL PROTECTED] 
>       Sent: Monday, April 02, 2007 4:53 PM
>       To: [email protected]
>       Subject: No writeable property in class. Bug? Strange work
> arounds.
>       
>       
> 
>       I think I have a similar problem to this thread
> <http://www.nabble.com/There-is-no-WRITEABLE-property-called-%27UserId%2
> 7-in-AppUser-tf1404646.html#a3789203> . 
> 
>       I have some columns named c_value, l_state etc in the db (I
> can't change the scheme) and the abator generated code complains that
> "There is no WRITEABLE property named 'cValue' in class
> 'com.fonterra.tams.orm.abator.model.TankerLog'", when in fact there is. 
> 
>       Two things seem to fix this - either using 
>       columnOverride column="l_state" property="LState"
> 
>       or 
> 
>       Setting useActualColumnNames to *true* for each table that has
> this problem. 
> 
>       or 
> 
>       Renaming the db column simply to double the first lower case
> letter (e.g. ll_state instead of l_state). 
> 
>       I'd prefer not to have to do either. 
> 
>       Any ideas? 
>       Caused by: java.lang.RuntimeException: Error initialising
> BaseIbatisDao class. Cause: java.lang.RuntimeException: Error occurred.
> Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
> Cause: java.lang.RuntimeException: Error parsing XPath
> '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException:
> Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing
> XPath '/sqlMap/resultMap/result'.  Cause:
> com.ibatis.common.beans.ProbeException: There is no WRITEABLE property
> named 'cValue' in class 'com.fonterra.tams.orm.abator.model.TankerLog'
>       tanker_log_SqlMap.xml
> <http://www.nabble.com/file/7622/tanker_log_SqlMap.xml> TankerLog.java
> <http://www.nabble.com/file/7623/TankerLog.java> TruckTDAOImpl.java
> <http://www.nabble.com/file/7624/TruckTDAOImpl.java>  
>                       table schema="tams" tableName="tanker_log"
> modelType="flat" 
>                               columnOverride column="l_state"
> property="LState"/
>                               columnOverride column="a_min"
> property="AMin"/              
>                       /table
>       DROP TABLE IF EXISTS `tams`.`tanker_log`;
>       CREATE TABLE  `tams`.`tanker_log` (
>         `tanker_header_id` int(10) unsigned NOT NULL auto_increment,
>         `tanker_message_id` int(10) unsigned NOT NULL default '0',
>         `variable_id` int(10) unsigned NOT NULL default '0',
>         `sample_timestamp` int(10) unsigned NOT NULL default '0',
>         `l_state` varchar(3) NOT NULL default '',
>         `cc_value` int(10) unsigned NOT NULL default '0',
>         `a_min` int(10) unsigned NOT NULL default '0',
>         `a_max` int(10) unsigned NOT NULL default '0',
>         `a_avg` int(10) unsigned NOT NULL default '0',
>         `a_snapshot` int(10) unsigned NOT NULL default '0',
>         `a_in_greenband` varchar(3) NOT NULL default '',
>         `a_in_greenband_duration` int(10) unsigned NOT NULL default
> '0',
>         PRIMARY KEY
> (`tanker_header_id`,`tanker_message_id`,`variable_id`,`sample_timestamp`
> )
>       ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
> 
> ________________________________
> 
>       View this message in context: No writeable property in class.
> Bug? Strange work arounds.
> <http://www.nabble.com/No-writeable-property-in-class.-Bug--Strange-work
> -arounds.-tf3508972.html#a9801228> 
>       Sent from the iBATIS - User - Java mailing list archive
> <http://www.nabble.com/iBATIS---User---Java-f370.html>  at Nabble.com.
>       
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/No-writeable-property-in-class.-Bug--Strange-work-arounds.-tf3508972.html#a9801546
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Reply via email to