Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] concat function within constructor expression fails

Hi Ravi,

  This looks like a bug.  Please file a bug in Bugzilla.

-Tom

Ravi Venkatesan wrote:
Hi,
I recently moved a project from Hibernate to EclipseLink as the JPA provider. One of the named queries I have uses the concat function within a constructor expression that is part of a named query. This however seems to break in EclipseLink. Based on the stack trace where it is looking for a constructor excluding the field that uses the concatenated field it looks like it totally ignores the concatenated field from the query. Any solutions will help. Here is the named query: @NamedQuery (name = "findAbhyasisForWorldMap", query = "SELECT NEW org.srcm.beans.wrapper.MapBeanWrapper(a.id <http://a.id>, a.location.lat, a.location.lon, concat(a.printName,a.lastName)) FROM Abhyasi a") Here is the stack trace:

Exception [EclipseLink-6137] (Eclipse Persistence Services - 1.2.0.v20091016-r5565):

_org.eclipse.persistence.exceptions.QueryException_

Exception Description: An Exception was thrown while executing a ReportQuery with a constructor expression:

_java.lang.NoSuchMethodException_: org.srcm.beans.wrapper.MapBeanWrapper.<init>(java.lang.Integer, java.lang.Double, java.lang.Double)

Query: ReportQuery(name="findAbhyasisForWorldMap" referenceClass=Abhyasi jpql="SELECT NEW org.srcm.beans.wrapper.MapBeanWrapper(a.id <http://a.id>, a.location.lat, a.location.lon, concat(a.printName,a.lastName)) FROM Abhyasi a")

at org.srcm.mms.dao.GenericDAOImpl.findByNamedQuery(

_GenericDAOImpl.java:70_)

at org.srcm.mms.dao.MapBeanDAOTest.testFindByNamedQuery(

_MapBeanDAOTest.java:34_)

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 junit.framework.TestCase.runTest(

_TestCase.java:168_)

at junit.framework.TestCase.runBare(

_TestCase.java:134_)

at org.springframework.test.ConditionalTestCase.runBare(

_ConditionalTestCase.java:76_)

at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.access$001(

_AbstractAnnotationAwareTransactionalTests.java:71_)

at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.run(

_AbstractAnnotationAwareTransactionalTests.java:175_)

at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTest(

_AbstractAnnotationAwareTransactionalTests.java:283_)

at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTestTimed(

_AbstractAnnotationAwareTransactionalTests.java:254_)

at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runBare(

_AbstractAnnotationAwareTransactionalTests.java:172_)

at org.springframework.test.jpa.AbstractJpaTests.runBare(

_AbstractJpaTests.java:174_)

at org.springframework.test.jpa.AbstractJpaTests.runBare(

_AbstractJpaTests.java:255_)

at junit.framework.TestResult$1.protect(

_TestResult.java:110_)

at junit.framework.TestResult.runProtected(

_TestResult.java:128_)

at junit.framework.TestResult.run(

_TestResult.java:113_)

at junit.framework.TestCase.run(

_TestCase.java:124_)

at junit.framework.TestSuite.runTest(

_TestSuite.java:232_)

at junit.framework.TestSuite.run(

_TestSuite.java:227_)

at org.junit.internal.runners.JUnit38ClassRunner.run(

_JUnit38ClassRunner.java:81_)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(

_JUnit4TestReference.java:46_)

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_)


------------------------------------------------------------------------

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top