Problem in Executing Named Query in Eclipse Link

View: New views
4 Messages — Rating Filter:   Alert me  

Problem in Executing Named Query in Eclipse Link

by Venu JaMocha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have written a Named Query in Open JPA, the query is like below:

@NamedQuery(name = "deleteActionEventByObjectId", query = "DELETE FROM ActionEventTO x WHERE x.eventDetail in (SELECT y.id FROM EventDetailTO y WHERE y.objectMaster.id = ?1 )")

The above query is excuted in Open JPA without any problem.

But the same query is not working in Eclipse Link.
Can some one help in this, it is bit urgent.

-- Regds,
Venu G

Re: Problem in Executing Named Query in Eclipse Link

by tware :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What is the error you are seeing?

Venu JaMocha wrote:

> I have written a Named Query in Open JPA, the query is like below:
>
> @NamedQuery(name = "deleteActionEventByObjectId", query = "DELETE FROM
> ActionEventTO x WHERE x.eventDetail in (SELECT y.id FROM EventDetailTO y
> WHERE y.objectMaster.id = ?1 )")
>
> The above query is excuted in Open JPA without any problem.
>
> But the same query is not working in Eclipse Link.
> Can some one help in this, it is bit urgent.
>
> -- Regds,
> Venu G
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Problem in Executing Named Query in Eclipse Link

by Venu JaMocha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[EL Info]: EclipseLink, version: Eclipse Persistence Services - 1.1.1.v20090430-r4097
[EL Severe]: Local Exception Stack:
Exception [EclipseLink-8022] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Error compiling the query [deleteActionEventByObjectId: DELETE FROM  Actionevent x WHERE x.eventid in (SELECT y.id FROM Eventdetail y WHERE y.objectid.id = ?1 )], line 0, column 0: invalid IN expression argument [SubqueryNode
  Left: null
  Right: null], expected argument of type [com.jamochatech.poc.eclipselink.Eventdetail].
        at org.eclipse.persistence.exceptions.JPQLException.invalidExpressionArgument(JPQLException.java:318)
        at org.eclipse.persistence.internal.jpa.parsing.InNode.validate(InNode.java:73)
        at org.eclipse.persistence.internal.jpa.parsing.WhereNode.validate(WhereNode.java:34)
        at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:211)
        at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:187)
        at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:177)
        at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateModifyQueryInternal(JPQLParseTree.java:146)
        at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateQuery(JPQLParseTree.java:93)
        at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:160)
        at org.eclipse.persistence.internal.jpa.JPAQuery.processJPQLQuery(JPAQuery.java:94)
        at org.eclipse.persistence.internal.jpa.JPAQuery.prepare(JPAQuery.java:85)
        at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:458)
        at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:424)
        at org.eclipse.persistence.internal.sessions.AbstractSession.processJPAQueries(AbstractSession.java:1689)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:409)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:666)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:630)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:229)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:255)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:111)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:163)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:150)
        at com.jamochatech.poc.eclipselink.DBManager.getEntityManager(DBManager.java:97)
        at com.jamochatech.poc.eclipselink.DBManager.findEntityById(DBManager.java:109)
        at com.jamochatech.poc.eclipselink.DBTest.main(DBTest.java:35)




tware wrote:
What is the error you are seeing?

Venu JaMocha wrote:
> I have written a Named Query in Open JPA, the query is like below:
>
> @NamedQuery(name = "deleteActionEventByObjectId", query = "DELETE FROM
> ActionEventTO x WHERE x.eventDetail in (SELECT y.id FROM EventDetailTO y
> WHERE y.objectMaster.id = ?1 )")
>
> The above query is excuted in Open JPA without any problem.
>
> But the same query is not working in Eclipse Link.
> Can some one help in this, it is bit urgent.
>
> -- Regds,
> Venu G
_______________________________________________
eclipselink-users mailing list
eclipselink-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Problem in Executing Named Query in Eclipse Link

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could you include your mappings/class def for Actionevent.


[EL Info]: EclipseLink, version: Eclipse Persistence Services - 1.1.1.v20090430-r4097
[EL Severe]: Local Exception Stack:
Exception [EclipseLink-8022] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Error compiling the query [deleteActionEventByObjectId: DELETE FROM  Actionevent x WHERE x.eventid in (SELECT y.id FROM Eventdetail y WHERE y.objectid.id = ?1 )], line 0, column 0: invalid IN expression argument [SubqueryNode
  Left: null
  Right: null], expected argument of type [com.jamochatech.poc.eclipselink.Eventdetail].
        at org.eclipse.persistence.exceptions.JPQLException.invalidExpressionArgument(JPQLException.java:318)
        at org.eclipse.persistence.internal.jpa.parsing.InNode.validate(InNode.java:73)
        at org.eclipse.persistence.internal.jpa.parsing.WhereNode.validate(WhereNode.java:34)
        at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:211)
        at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:187)
        at org.eclipse.persistence.internal.jpa.parsing.ParseTree.validate(ParseTree.java:177)
        at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateModifyQueryInternal(JPQLParseTree.java:146)
        at org.eclipse.persistence.internal.jpa.parsing.JPQLParseTree.populateQuery(JPQLParseTree.java:93)
        at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:160)
        at org.eclipse.persistence.internal.jpa.JPAQuery.processJPQLQuery(JPAQuery.java:94)
        at org.eclipse.persistence.internal.jpa.JPAQuery.prepare(JPAQuery.java:85)
        at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:458)
        at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:424)
        at org.eclipse.persistence.internal.sessions.AbstractSession.processJPAQueries(AbstractSession.java:1689)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:409)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:666)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:630)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:229)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:255)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:111)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:163)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:150)
        at com.jamochatech.poc.eclipselink.DBManager.getEntityManager(DBManager.java:97)
        at com.jamochatech.poc.eclipselink.DBManager.findEntityById(DBManager.java:109)
        at com.jamochatech.poc.eclipselink.DBTest.main(DBTest.java:35)




tware wrote:
What is the error you are seeing?

Venu JaMocha wrote:
> I have written a Named Query in Open JPA, the query is like below:
>
> @NamedQuery(name = "deleteActionEventByObjectId", query = "DELETE FROM
> ActionEventTO x WHERE x.eventDetail in (SELECT y.id FROM EventDetailTO y
> WHERE y.objectMaster.id = ?1 )")
>
> The above query is excuted in Open JPA without any problem.
>
> But the same query is not working in Eclipse Link.
> Can some one help in this, it is bit urgent.
>
> -- Regds,
> Venu G