Hello, everybody.
I have a question here. I am trying to build a select clause like "SELECT *
FROM Course WHERE number LIKE '1%'". Course is the table name. number is a
column in the table and the date type is VARCHAR. I use CMP. JBoss will
generate the select for me. Only I need to do is telling JBoss this in
jaws.xml.
Here is the part of jaws.xml
<enterprise-beans>
<entity>
<ejb-name>CourseBean</ejb-name>
<finder>
<name>findByDepartmentAndNumber</name>
<query>deptid = {0} AND number LIKE '{1}%' </query>
<!-- <query>deptid = {0} AND number LIKE {1}'%' </query>-->
<!-- <query>deptid = {0} AND number LIKE {1}+'%' </query>-->
<order>number ASCE</order>
</finder>
..............
</enterprise-beans>
</entity>
You can see I try different ways including LIKE '{1}%', LIKE {1}'%',LIKE
{1}+'%'. But it doesn't work.
JBoss always tell me this in the console:
[Hypersonic] java.lang.NumberFormatException: CSCI
[Hypersonic] at java.lang.Integer.parseInt(Integer.java:414)
[Hypersonic] at java.lang.Integer.<init>(Integer.java:549)
[Hypersonic] at org.hsql.Column.convertString(Column.java:523)
[Hypersonic] at org.hsql.Expression.getValue(Expression.java:334)
[Hypersonic] at org.hsql.Expression.test(Expression.java:457)
[Hypersonic] at org.hsql.TableFilter.test(TableFilter.java:181)
[Hypersonic] at org.hsql.TableFilter.findFirst(TableFilter.java:137)
[Hypersonic] at org.hsql.Select.getResult(Select.java:103)
[Hypersonic] at org.hsql.Parser.processSelect(Parser.java:27)
[Hypersonic] at org.hsql.Database.execute(Database.java:120)
[Hypersonic] at org.hsql.ServerConnection.run(ServerConnection.java:58)
Information in client-side is:
java edu/uncc/coit/course/ListCourses CSCI 1000
Exception in thread "main" javax.ejb.FinderException: Find failed
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown
Source)
at
org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:188)
at $Proxy1.findByDeptNameAndLevel(Unknown Source)
at edu.uncc.coit.course.ListCourses.listCourses(ListCourses.java:58)
at edu.uncc.coit.course.ListCourses.main(ListCourses.java:43)
Is there anybody knowing how to config it in jaws.xml?
Thanks.
Cindy
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development