Aggregate projections not supported in Querydsl Collections #932

Closed
oscarbou opened this Issue Sep 10, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@oscarbou

I have configured my project on Eclipse to run with JDK7.

Despite that, my JAVA_HOME points to another JRE 8 installation I have.

When trying to run tests from Eclipse I obtain the following error message:

StatsForRiskAssessmentsTests
com.xms.framework.risk.integration.tests.reporting.StatsForRiskAssessmentsTests
testNumberOfRisksByLevelOfRisk(com.xms.framework.risk.integration.tests.reporting.StatsForRiskAssessmentsTests)
com.mysema.codegen.CodegenException: Compilation of public class Q_01085021648_0500385818_2137843372_0522559049 {

public static com.xms.framework.risk.reporting.model.NumberOfRisksByLevelOfRisk eval(com.xms.framework.risk.domain.model.Risk risk, com.mysema.query.types.QBean a1) {

return (com.xms.framework.risk.reporting.model.NumberOfRisksByLevelOfRisk)(a1.newInstance(risk.getEffectiveLevelOfRisk(), count(*))); }

}

failed.
/Q_01085021648_0500385818_2137843372_0522559049.java:4: error: illegal start of expression
return (com.xms.framework.risk.reporting.model.NumberOfRisksByLevelOfRisk)(a1.newInstance(risk.getEffectiveLevelOfRisk(), count())); }
^
/Q_01085021648_0500385818_2137843372_0522559049.java:4: error: illegal start of expression
return (com.xms.framework.risk.reporting.model.NumberOfRisksByLevelOfRisk)(a1.newInstance(risk.getEffectiveLevelOfRisk(), count(
))); }
^
2 errors

at com.mysema.codegen.JDKEvaluatorFactory.compile(JDKEvaluatorFactory.java:74)
at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:128)
at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:94)
at com.mysema.query.collections.DefaultEvaluatorFactory.create(DefaultEvaluatorFactory.java:125)
at com.mysema.query.collections.DefaultQueryEngine.project(DefaultQueryEngine.java:234)
at com.mysema.query.collections.DefaultQueryEngine.evaluateSingleSource(DefaultQueryEngine.java:192)
at com.mysema.query.collections.DefaultQueryEngine.list(DefaultQueryEngine.java:91)
at com.mysema.query.collections.AbstractCollQuery.list(AbstractCollQuery.java:202)
at com.xms.framework.risk.reporting.model.StatsForRiskAssessments.findNumberOfRisksByLevelOfRisk(StatsForRiskAssessments.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetViaMethod.internalInvoke(ActionInvocationFacetViaMethod.java:268)
at org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetViaMethod.invoke(ActionInvocationFacetViaMethod.java:131)
at org.apache.isis.core.runtime.transaction.facets.ActionInvocationFacetWrapTransaction$1.execute(ActionInvocationFacetWrapTransaction.java:57)
at org.apache.isis.core.runtime.transaction.facets.ActionInvocationFacetWrapTransaction$1.execute(ActionInvocationFacetWrapTransaction.java:54)
at org.apache.isis.core.runtime.system.transaction.IsisTransactionManager.executeWithinTransaction(IsisTransactionManager.java:201)
at org.apache.isis.core.runtime.transaction.facets.ActionInvocationFacetWrapTransaction.invoke(ActionInvocationFacetWrapTransaction.java:54)
at org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionImpl.execute(ObjectActionImpl.java:342)
at org.apache.isis.core.wrapper.handlers.DomainObjectInvocationHandler.handleActionMethod(DomainObjectInvocationHandler.java:547)
at org.apache.isis.core.wrapper.handlers.DomainObjectInvocationHandler.invoke(DomainObjectInvocationHandler.java:226)
at org.apache.isis.core.wrapper.proxy.ProxyInstantiatorForJavassist$1.invoke(ProxyInstantiatorForJavassist.java:52)
at com.xms.framework.risk.reporting.model.StatsForRiskAssessments_$$_jvst42_30.findNumberOfRisksByLevelOfRisk(StatsForRiskAssessments_$$_jvst42_30.java)
at com.xms.framework.risk.integration.tests.reporting.StatsForRiskAssessmentsTests.testNumberOfRisksByLevelOfRisk(StatsForRiskAssessmentsTests.java:251)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.apache.isis.core.integtestsupport.IntegrationTestAbstract$IsisTransactionRule$1.evaluate(IntegrationTestAbstract.java:174)
at org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2$1.evaluate(JUnitRuleMockery2.java:146)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:168)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
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)

testNumberOfRisksByAssetType(com.xms.framework.risk.integration.tests.reporting.StatsForRiskAssessmentsTests)
com.mysema.codegen.CodegenException: Compilation of public class Q_0663503718_01383349348_550055586_02095056267 {

public static java.util.Map eval(com.xms.framework.risk.reporting.model.StatsForRiskAssessments.NumberOfRisksByAsset numberOfRisksByAsset, com.mysema.query.types.QMap a1) {

return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count(*) as numberOfRisks)); }

}

failed.
/Q_0663503718_01383349348_550055586_02095056267.java:4: error: illegal start of expression
return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count() as numberOfRisks)); }
^
/Q_0663503718_01383349348_550055586_02095056267.java:4: error: illegal start of expression
return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count(
) as numberOfRisks)); }
^
/Q_0663503718_01383349348_550055586_02095056267.java:4: error: ')' expected
return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count() as numberOfRisks)); }
^
/Q_0663503718_01383349348_550055586_02095056267.java:4: error: ';' expected
return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count(
) as numberOfRisks)); }
^
/Q_0663503718_01383349348_550055586_02095056267.java:4: error: illegal start of expression
return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count() as numberOfRisks)); }
^
/Q_0663503718_01383349348_550055586_02095056267.java:4: error: ';' expected
return (java.util.Map)(a1.newInstance(numberOfRisksByAsset.getAsset().getType(), count(
) as numberOfRisks)); }
^
6 errors

at com.mysema.codegen.JDKEvaluatorFactory.compile(JDKEvaluatorFactory.java:74)
at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:128)
at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:94)
at com.mysema.query.collections.DefaultEvaluatorFactory.create(DefaultEvaluatorFactory.java:125)
at com.mysema.query.collections.DefaultQueryEngine.project(DefaultQueryEngine.java:234)
at com.mysema.query.collections.DefaultQueryEngine.evaluateSingleSource(DefaultQueryEngine.java:192)
at com.mysema.query.collections.DefaultQueryEngine.list(DefaultQueryEngine.java:91)
at com.mysema.query.collections.AbstractCollQuery.list(AbstractCollQuery.java:202)
at com.xms.framework.risk.reporting.model.StatsForRiskAssessments.findNumberOfRisksByAssetType(StatsForRiskAssessments.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetViaMethod.internalInvoke(ActionInvocationFacetViaMethod.java:268)
at org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetViaMethod.invoke(ActionInvocationFacetViaMethod.java:131)
at org.apache.isis.core.runtime.transaction.facets.ActionInvocationFacetWrapTransaction$1.execute(ActionInvocationFacetWrapTransaction.java:57)
at org.apache.isis.core.runtime.transaction.facets.ActionInvocationFacetWrapTransaction$1.execute(ActionInvocationFacetWrapTransaction.java:54)
at org.apache.isis.core.runtime.system.transaction.IsisTransactionManager.executeWithinTransaction(IsisTransactionManager.java:201)
at org.apache.isis.core.runtime.transaction.facets.ActionInvocationFacetWrapTransaction.invoke(ActionInvocationFacetWrapTransaction.java:54)
at org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionImpl.execute(ObjectActionImpl.java:342)
at org.apache.isis.core.wrapper.handlers.DomainObjectInvocationHandler.handleActionMethod(DomainObjectInvocationHandler.java:547)
at org.apache.isis.core.wrapper.handlers.DomainObjectInvocationHandler.invoke(DomainObjectInvocationHandler.java:226)
at org.apache.isis.core.wrapper.proxy.ProxyInstantiatorForJavassist$1.invoke(ProxyInstantiatorForJavassist.java:52)
at com.xms.framework.risk.reporting.model.StatsForRiskAssessments_$$_jvst42_30.findNumberOfRisksByAssetType(StatsForRiskAssessments_$$_jvst42_30.java)
at com.xms.framework.risk.integration.tests.reporting.StatsForRiskAssessmentsTests.testNumberOfRisksByAssetType(StatsForRiskAssessmentsTests.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.apache.isis.core.integtestsupport.IntegrationTestAbstract$IsisTransactionRule$1.evaluate(IntegrationTestAbstract.java:174)
at org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2$1.evaluate(JUnitRuleMockery2.java:146)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:168)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 11, 2014

Member

Querydsl Collections doesn't support aggregate expressions for the moment

Member

timowest commented Sep 11, 2014

Querydsl Collections doesn't support aggregate expressions for the moment

@timowest timowest added bug and removed bug labels Sep 14, 2014

@timowest timowest changed the title from Query compilation error on latest QueryDSL release 3.4.3 to Aggregate projections no suppoted in Querydsl Collections Oct 1, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Oct 1, 2014

Member

I updated the title to better reflect the issue.

Member

timowest commented Oct 1, 2014

I updated the title to better reflect the issue.

@Shredder121 Shredder121 changed the title from Aggregate projections no suppoted in Querydsl Collections to Aggregate projections no supported in Querydsl Collections Oct 1, 2014

@Shredder121 Shredder121 changed the title from Aggregate projections no supported in Querydsl Collections to Aggregate projections not supported in Querydsl Collections Oct 1, 2014

@timowest timowest added this to the 3.5.1 milestone Oct 9, 2014

@Shredder121 Shredder121 closed this in #1000 Oct 13, 2014

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