New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigDecimal not handle correctly #325

Closed
mattrebor opened this Issue Jan 12, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@mattrebor

I'm using the collection module and have classes with BigDecimal. However, it looks the BigDecimal aren't being handled properly in groupBy.

from(qH, l).transform(groupBy(qH.quantity.multiply(qH.price)).as(qH.desc));

It's trying to use the * instead of using BigDecimal.multiply

com.mysema.codegen.CodegenException: Compilation of return (Object[])(a1.newInstance(g.getQuantity() * g.getPrice(), g.getDesc())); failed.
/Q_01356270177_614832599_082509057_01258778333.java:6: operator * cannot be applied to java.math.BigDecimal,java.math.BigDecimal
return (Object[])(a1.newInstance(g.getQuantity() * g.getPrice(), g.getDesc())); }
^
1 error

at com.mysema.codegen.JDKEvaluatorFactory.compile(JDKEvaluatorFactory.java:91)
at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:77)
at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:46)
at com.mysema.query.collections.DefaultEvaluatorFactory.create(DefaultEvaluatorFactory.java:120)
at com.mysema.query.collections.DefaultQueryEngine.project(DefaultQueryEngine.java:218)
at com.mysema.query.collections.DefaultQueryEngine.evaluateSingleSource(DefaultQueryEngine.java:190)
at com.mysema.query.collections.DefaultQueryEngine.list(DefaultQueryEngine.java:82)
at com.mysema.query.collections.AbstractColQuery.iterate(AbstractColQuery.java:133)
at com.mysema.query.collections.AbstractColQuery.iterate(AbstractColQuery.java:125)
at com.mysema.query.group.GroupBy.transform(GroupBy.java:153)
at com.mysema.query.group.GroupBy.transform(GroupBy.java:1)
at com.mysema.query.support.ProjectableQuery.transform(ProjectableQuery.java:155)
at com.rt.test.PercentageUtilTest.testPercentageUtil(PercentageUtilTest.java:172)
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:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

timowest added a commit that referenced this issue Jan 12, 2013

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 13, 2013

Member

Released in 3.0.0.BETA1

Member

timowest commented Jan 13, 2013

Released in 3.0.0.BETA1

@timowest timowest closed this Jan 13, 2013

@timowest timowest added this to the 3.0.0 milestone Apr 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment