You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Annie Zhang <yh...@netzero.com> on 2002/04/05 00:25:12 UTC

Re: Strange Error!! urgent! still error!

Hi Weaver

Thank you for your reply. I have restored all the Torque java files. And use
SqlEnum.LIKE instead of Criteria.LIKE,  JBuilder still report ambiguous
error:

 c.add(SoOrderHeadersPeer.CUSTOMER_NAME, searchForm.getCustomerName(),
Criteria.LIKE);


"ViewOrdersAction.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 117, column 22

Should I delete the function from org.apache.torque.util.Criteria.java
     public Criteria add ( String table,
                           String column,
                           Object value )

Annie

----- Original Message -----
From: "Weaver, Scott" <Sw...@rippe.com>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Thursday, April 04, 2002 1:54 PM
Subject: RE: Strange Error!! urgent!


> 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:yhzhang73@netzero.com]
> > 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
> >
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>