Why are you trying to access SqlEnum.LIKE? Just use what is given to you by the Criteria class.
c.add(SoOrderHeadersPeer.CUSTOMER_NAME, searchForm.getCustomerName(), Criteria.LIKE); p.s. For future reference, Torque questions should be posted to the new torque-user and/or torque-dev mailing lists. Scott > -----Original Message----- > From: Annie Zhang [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 04, 2002 3:44 PM > To: Turbine Users List > Subject: 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 >
