Skip to main content

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

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

Back to the top