You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Jonathan Prater <jo...@gmail.com> on 2007/07/01 14:51:52 UTC
"There is no READABLE property named 'condition' in class 'java.util.ArrayList'".
package com.jpprater.libutils.persist;
import java.util.List;
public final class BCriteria {
private String field;
private String condition;
private String svalue = null;
private Integer ivalue1 = null;
private Integer ivalue2 = null;
private List<String> lvalues = null;
public BCriteria() {
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
public String getSvalue() {
return svalue;
}
public void setSvalue(String svalue) {
this.svalue = svalue;
}
public Integer getIvalue1() {
return ivalue1;
}
public void setIvalue1(Integer ivalue1) {
this.ivalue1 = ivalue1;
}
public Integer getIvalue2() {
return ivalue2;
}
public void setIvalue2(Integer ivalue2) {
this.ivalue2 = ivalue2;
}
public List<String> getLvalues() {
return lvalues;
}
public void setLvalues(List<String> lvalues) {
this.lvalues = lvalues;
}
}
RE: "There is no READABLE property named 'condition' in class 'java.util.ArrayList'".
Posted by Hofri Yehuda <Ye...@comverse.com>.
where's the datasource config file ?
________________________________
From: Jonathan Prater [mailto:jonathan.prater@gmail.com]
Sent: Sunday, July 01, 2007 3:52 PM
To: user-java@ibatis.apache.org
Subject: "There is no READABLE property named 'condition' in class
'java.util.ArrayList'".
I have written a class called BookExample to run a search against a
HSQLDB database. The source for this class is attached. BookExample
also refers to a class called BCriteria, which has a variable called
"condition". I've provided a getter and setter for that variable. And
yet, when I try to run a search using that class, I get an exception
message saying "There is no READABLE property named 'condition' in class
'java.util.ArrayList'". I've attached the SQLMap file that refers to
this class. Here's the stack trace I get when I try to run my search...
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/jpprater/libutils/persist/PUBLIC_BKCATALOG_SqlMap.xml.
--- The error occurred while preparing the mapped statement for
execution.
--- Check the book_selectByExample.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: There is no READABLE
property named 'condition' in class 'java.util.ArrayList'
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
WithCallback(GeneralStatement.java:188)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
ForList(GeneralStatement.java:123)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMap
ExecutorDelegate.java:615)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMap
ExecutorDelegate.java:589)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessi
onImpl.java:118)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClient
Impl.java:95)
at com.jpprater.libutils.Library.search(Library.java:48)
at
com.jpprater.libmgr.LibMgrMainFrame.btnSrchAdvActionPerformed(LibMgrMain
Frame.java:204)
at
com.jpprater.libmgr.LibMgrMainFrame.access$300(LibMgrMainFrame.java:24)
at
com.jpprater.libmgr.LibMgrMainFrame$4.actionPerformed(LibMgrMainFrame.ja
va:97)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2
318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.ja
va:387)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonList
ener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at
javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.
java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.jav
a:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.
java:173)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: com.ibatis.common.beans.ProbeException: There is no READABLE
property named 'condition' in class 'java.util.ArrayList'
at
com.ibatis.common.beans.ClassInfo.getGetter(ClassInfo.java:259)
at
com.ibatis.common.beans.ComplexBeanProbe.getProperty(ComplexBeanProbe.ja
va:304)
at
com.ibatis.common.beans.ComplexBeanProbe.getObject(ComplexBeanProbe.java
:190)
at
com.ibatis.common.beans.GenericProbe.getObject(GenericProbe.java:74)
at
com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.processDyna
micElements(SimpleDynamicSql.java:83)
at
com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.getSql(Simp
leDynamicSql.java:45)
at
com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.process(DynamicS
ql.java:90)
at
com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.getParameterMap(
DynamicSql.java:61)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
WithCallback(GeneralStatement.java:156)
... 34 more
Anyone have any ideas?
Jon
Re: "There is no READABLE property named 'condition' in class 'java.util.ArrayList'".
Posted by Larry Meadors <lm...@apache.org>.
The message is correct:
- There is no READABLE property named 'condition' in class
'java.util.ArrayList'
You are referring to "$andedCrits.condition$", and andedCrits is an
ArrayList without that property.
Larry
On 7/1/07, Jonathan Prater <jo...@gmail.com> wrote:
>
> I have written a class called BookExample to run a search against a HSQLDB
> database. The source for this class is attached. BookExample also refers
> to a class called BCriteria, which has a variable called "condition". I've
> provided a getter and setter for that variable. And yet, when I try to run
> a search using that class, I get an exception message saying "There is no
> READABLE property named 'condition' in class 'java.util.ArrayList'". I've
> attached the SQLMap file that refers to this class. Here's the stack trace
> I get when I try to run my search...
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in
> com/jpprater/libutils/persist/PUBLIC_BKCATALOG_SqlMap.xml.
> --- The error occurred while preparing the mapped statement for execution.
> --- Check the book_selectByExample.
> --- Check the parameter map.
> --- Cause: com.ibatis.common.beans.ProbeException: There
> is no READABLE property named 'condition' in class 'java.util.ArrayList'
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95)
> at
> com.jpprater.libutils.Library.search(Library.java:48)
> at
> com.jpprater.libmgr.LibMgrMainFrame.btnSrchAdvActionPerformed(LibMgrMainFrame.java:204)
> at
> com.jpprater.libmgr.LibMgrMainFrame.access$300(LibMgrMainFrame.java:24)
> at
> com.jpprater.libmgr.LibMgrMainFrame$4.actionPerformed(LibMgrMainFrame.java:97)
> at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
> at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
> at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
> at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
> at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
> at
> java.awt.Component.processMouseEvent(Component.java:6038)
> at
> javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
> at java.awt.Component.processEvent(Component.java:5803)
> at java.awt.Container.processEvent(Container.java:2058)
> at
> java.awt.Component.dispatchEventImpl(Component.java:4410)
> at
> java.awt.Container.dispatchEventImpl(Container.java:2116)
> at
> java.awt.Component.dispatchEvent(Component.java:4240)
> at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
> at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
> at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
> at
> java.awt.Container.dispatchEventImpl(Container.java:2102)
> at
> java.awt.Window.dispatchEventImpl(Window.java:2429)
> at
> java.awt.Component.dispatchEvent(Component.java:4240)
> at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
> at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
> at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
> at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
> Caused by: com.ibatis.common.beans.ProbeException: There
> is no READABLE property named 'condition' in class 'java.util.ArrayList'
> at
> com.ibatis.common.beans.ClassInfo.getGetter(ClassInfo.java:259)
> at
> com.ibatis.common.beans.ComplexBeanProbe.getProperty(ComplexBeanProbe.java:304)
> at
> com.ibatis.common.beans.ComplexBeanProbe.getObject(ComplexBeanProbe.java:190)
> at
> com.ibatis.common.beans.GenericProbe.getObject(GenericProbe.java:74)
> at
> com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.processDynamicElements(SimpleDynamicSql.java:83)
> at
> com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.getSql(SimpleDynamicSql.java:45)
> at
> com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.process(DynamicSql.java:90)
> at
> com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.getParameterMap(DynamicSql.java:61)
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:156)
> ... 34 more
>
> Anyone have any ideas?
>
> Jon
> package com.jpprater.libutils.persist;
>
> import java.util.List;
>
>
> public final class BCriteria {
>
> private String field;
> private String condition;
> private String svalue = null;
> private Integer ivalue1 = null;
> private Integer ivalue2 = null;
> private List<String> lvalues = null;
> public BCriteria() {
>
> }
>
> public String getField() {
> return field;
> }
>
> public void setField(String field) {
> this.field = field;
> }
>
> public String getCondition() {
> return condition;
> }
>
> public void setCondition(String condition) {
> this.condition = condition;
> }
>
> public String getSvalue() {
> return svalue;
> }
>
> public void setSvalue(String svalue) {
> this.svalue = svalue;
> }
>
> public Integer getIvalue1() {
> return ivalue1;
> }
>
> public void setIvalue1(Integer ivalue1) {
> this.ivalue1 = ivalue1;
> }
>
> public Integer getIvalue2() {
> return ivalue2;
> }
>
> public void setIvalue2(Integer ivalue2) {
> this.ivalue2 = ivalue2;
> }
>
> public List<String> getLvalues() {
> return lvalues;
> }
>
> public void setLvalues(List<String> lvalues) {
> this.lvalues = lvalues;
> }
>
> }
> /*
> * BookExample.java
> *
> * Created on June 24, 2007, 10:26 PM
> *
> * Used to generate SQL searches in iBATIS
> */
>
> package com.jpprater.libutils.persist;
>
> import java.util.ArrayList;
> import java.util.List;
>
> /**
> *
> * @author Jonathan.Prater
> */
> public class BookExample {
>
> private List<BCriteria> andedCrits;
> private String orderBy;
> private boolean loaned;
>
> /** Creates a new instance of BookExample */
> public BookExample() {
> andedCrits = new ArrayList<BCriteria>();
> }
>
> public void addString(String field, String condition, String value) {
> BCriteria toAdd = new BCriteria();
> toAdd.setField(field);
> toAdd.setCondition(condition);
> toAdd.setSvalue(value);
> andedCrits.add(toAdd);
> }
>
> public void addInt(String field, String condition, Integer val1, Integer
> val2) {
> BCriteria toAdd = new BCriteria();
> toAdd.setField(field);
> toAdd.setCondition(condition);
> toAdd.setIvalue1(val1);
> toAdd.setIvalue2(val2);
> andedCrits.add(toAdd);
> }
>
> public void addList(String field, String condition, List<String> values)
> {
> BCriteria toAdd = new BCriteria();
> toAdd.setField(field);
> toAdd.setCondition(condition);
> toAdd.setLvalues(values);
> andedCrits.add(toAdd);
> }
>
> public List<BCriteria> getAndedCrits() {
> return andedCrits;
> }
>
> public void setAndedCrits(List<BCriteria> andedCrits) {
> this.andedCrits = andedCrits;
> }
>
> public String getOrderBy() {
> return orderBy;
> }
>
> public void setOrderBy(String orderBy) {
> this.orderBy = orderBy;
> }
>
> public boolean isLoaned() {
> return loaned;
> }
>
> public void setLoaned(boolean loaned) {
> this.loaned = loaned;
> }
>
>
> }
>
>
>