Re: JESS: Function Parameters
"Ernest Friedman-Hill" <[email protected]> Wed, 16 Feb 2011 16:35:11 -0500
| Newsgroups | gmane.comp.java.jess |
|---|---|
| Message-ID | <[email protected]> |
Hi Derek, I'm trying to figure out where the problem might lie. Is the problem that "eq" an overloaded method, and Jess is calling the wrong overload? Jess can correctly call a method that takes a char as an argument, and in fact, it's smart enough to prefer the "char" overload if the argument is a one-character string. Or is it something else? I'm not sure what throws the ClassCastExcepton and why. Some code would help me understand! On Feb 16, 2011, at 3:14 PM, Derek Adams wrote: > Hello Jess-Users, > > I have small jess/java issue that is causing quite a big problem. > > (call (call ?hcu joinTo "projectStatus") eq "active" Y) > > The jess code above is performing the following: > > 1. In the inner "call", it is calling the joinTo function on the > instance of the HibernateCritieriaUtil object, with a parameter of > "projectStatus". > 2. That call returns another HibernateCritieriaUtil instance to be > used in the outer "call". > 3. The outer "call" is calling the eq function with 2 parameters, > "active" and Y. > > The problem is coming when the function interprets Y as a string. > "active" represents a column in the bean mapping and has a type of > char. > So when it compares "active" with a string Y, it throws a > ClassCastException: type String cannot be cast to type char > > Suggestions? > > -- > Derek Adams > Lead Developer > Arahant LLC > Work: 615-376-5500 ext. 314 > Cell: 270-543-0920 --------------------------------------------------------- Ernest Friedman-Hill Informatics & Decision Sciences Phone: (925) 294-2154 Sandia National Labs PO Box 969, MS 9012 [email protected] Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [email protected]' in the BODY of a message to [email protected], NOT to the list (use your own address!) List problems? Notify [email protected]. --------------------------------------------------------------------