db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campbell, Justin" <jcampb...@profilesys.com>
Subject Trouble casting objects -- possible java issue?
Date Fri, 17 Jan 2003 19:01:22 GMT
I'm using Torque 3.0 and attempting to setup a criteria using a "LIKE"

I setup my Criteria object as such:

  Criteria crit = new Criteria();
  crit.add(CompanyInfoPeer.COMPANYNAME, (Object)"%foobar%", Criteria.LIKE);

However, this refuses to compile, citing that this is an ambiguous call to
one of two methods "add" (one that accepts "String, String, SqlEnum" and one
that accepts "String, Object, SqlEnum" -- I am attempting to call the
latter). Clearly, the compiler is ignoring my "upward cast" to Object from
String. So far, the only viable solution I've found is to retrieve the
string "%foobar%" as a CharSequence (actually an instance of String in this

Am I missing something here? Is this an issue with Torque, my code or a
genuine issue with the java compiler?

Any help is greatly appreciated. Thanks in advance.

Justin Campbell
Project Technical Lead
Profile Systems, Inc.

View raw message