You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Annie Zhang <yh...@netzero.com> on 2002/04/04 23:21:23 UTC
Fw: Strange Error!! urgent!
Hi, I meet a strange error while using Criteria:
I want to apply " CUSTOMER_NAME like ......" as a condition in query. My code like this:
Criteria c = new Criteria();
c.add(SoOrderHeadersPeer.CUSTOMER_NAME, searchForm.getCustomerName(), SqlEnum.LIKE);
1.
The compiler report a error:
"XXXXX.java": Error #: 307 : class org.apache.torque.util.SqlEnum is not public in package org.apache.torque.util; cannot be accessed from outside package at line 123, column 118
2.
I checked org.apache.torque.util.SqlEnum.java, and add "public" in the class definition.
Another strange error occured:
"XXXXXX.java": Error #: 304 : reference to add is ambiguous; both method add(java.lang.String, java.lang.Object, org.apache.torque.util.SqlEnum) in class org.apache.torque.util.Criteria and method add(java.lang.String, java.lang.String, java.lang.Object) in class org.apache.torque.util.Criteria match at line 123, column 22
3.
Then, I change my code like this:
c.add((String)(SoOrderHeadersPeer.ORDER_NUMBER), (String)(searchForm.getOrderNumber()), (SqlEnum)(SqlEnum.LIKE));
The error still exist.
4.
Then, I delete the function from org.apache.torque.util.Criteria.java
public Criteria add ( String table,
String column,
Object value )
It's Ok now. Strange????
Very Strange!
What's the problem?? Can you give me some light about this?
Thanks
Annie