MySQL : 4.1
Cayenne: 1.1
Hi everyone,
I have noticed the following:
This code:
Long myId = new Long ("216201000180");
[...]
SelectQuery qcw = new SelectQuery(Employee.class);
Expression exp = Expression.fromString("empCode = " + myId.toString());
qcw.setQualifier(exp);
mContext.performQuery(qcw);
This results in in an 'org.objectstyle.cayenne.exp.ExpressionException'.
'empCode' is of type long/bigint. When examining the stackTrace, I have
noticed that 216201000180 is being handled as an Integer, not a Long.
The workaround is to use 'empCode' as a String, but this is not the way
things should work, I guess.
So, am I doing something wrong (if so, what) or should I log this a bug
somewhere (if so, where :-)?
Kind regards, Laszlo
PS: the Stacktrace:
org.objectstyle.cayenne.exp.ExpressionException: [v.1.1 December 6 2004] For
input string: "216201000180"
at org.objectstyle.cayenne.exp.Expression.fromString(Expression.java:234)
at
org.pva.handler.test.WngCpxResolverHandlerTester.testGetCustomWoning(WngCpxResolverHandlerTester.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
Caused by: java.lang.NumberFormatException: For input string: "216201000180"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:459)
at java.lang.Integer.valueOf(Integer.java:526)
at
org.objectstyle.cayenne.exp.parser.ExpressionParserTokenManager.makeInt(ExpressionParserTokenManager.java:118)
at
org.objectstyle.cayenne.exp.parser.ExpressionParserTokenManager.TokenLexicalActions(ExpressionParserTokenManager.java:1585)
at
org.objectstyle.cayenne.exp.parser.ExpressionParserTokenManager.getNextToken(ExpressionParserTokenManager.java:1459)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.jj_ntk(ExpressionParser.java:1350)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.scalarExpression(ExpressionParser.java:763)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.simpleCondition(ExpressionParser.java:275)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.notCondition(ExpressionParser.java:226)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.andCondition(ExpressionParser.java:134)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.orCondition(ExpressionParser.java:94)
at
org.objectstyle.cayenne.exp.parser.ExpressionParser.expression(ExpressionParser.java:87)
at org.objectstyle.cayenne.exp.Expression.fromString(Expression.java:227)
... 14 more
_________________________________________________________________
MSN Search, for accurate results! http://search.msn.nl
This archive was generated by hypermail 2.0.0 : Tue Jan 04 2005 - 07:00:36 EST