ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Stubbs <antony.stu...@gmail.com>
Subject Re: No writeable property in class. Bug? Strange work arounds.
Date Tue, 03 Apr 2007 03:17:30 GMT

Darn.

Ah well, as long as there's a work around that's not too much hassle. From
an API point of view, it doesn't make a difference though I suppose as the
set/get methods still look the same with the LState as lState. Just hope I
don't hit anything where I want to use the class with some other bean
utilities that want the private field to look like lState. But it's private
right? ;)

Now I've just got to fix my other problem with WebSphere and Struts2 - 
http://www.nabble.com/forum/ViewPost.jtp?post=9793011&framed=y here .


Clinton Begin wrote:
> 
> Yes.  The JavaBeans spec is a bit off.  I really don't know why they were
> so
> goofy about the lowercase letter jazz.   Would it have been the end of the
> world to have:
> 
> Employee.FirstName
> 
> ...as the property? At least then we could distinguish it from a darn
> field
> and you could use any capitalization you wanted after set/get/is.  If they
> had only asked us, eh?  ;-)
> 
> Clinton
> 
> On 4/2/07, Antony Stubbs <antony.stubbs@gmail.com> wrote:
>>
>>
>> Good news.
>>
>> Is it this  http://issues.apache.org/jira/browse/IBATIS-370 issue ? It's
>> marked as invalid. So we have to work with this?
>>
>> "This isn't a bug - it is a peculiarity in the Javabeans spec. It turns
>> out
>> that it is impossible to have a property with only the first letter being
>> lower case. You must specify the property as "XAxis"."
>>
>>
>> Jeff Butler-2 wrote:
>> >
>> > There is a bug in Abator 1.0 releted to this.  The bug has fixed in SVN
>> > for
>> > some time, so if you
>> > download the new source build it yourself things will be better.
>> >
>> > Jeff Butler
>> >
>> >
>> > On 4/2/07, Antony Stubbs <antony.stubbs@gmail.com> wrote:
>> >>
>> >>
>> >> 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:antony.stubbs@gmail.com]
>> >> >       Sent: Monday, April 02, 2007 4:53 PM
>> >> >       To: user-java@ibatis.apache.org
>> >> >       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.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/No-writeable-property-in-class.-Bug--Strange-work-arounds.-tf3508972.html#a9802836
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

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


Mime
View raw message