[
https://issues.jboss.org/browse/WFLY-7567?page=com.atlassian.jira.plugin....
]
Scott Marlow closed WFLY-7567.
------------------------------
Resolution: Rejected
Please report this via [Hibernate
ORM|http://hibernate.org] project, which is where you
can find information about what has changed in different versions of Hibernate ORM, as
well as ask questions + report bugs.
Sorry it took me so long to comment.
Getting an unexpected token : UNION when running a query
--------------------------------------------------------
Key: WFLY-7567
URL:
https://issues.jboss.org/browse/WFLY-7567
Project: WildFly
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 10.1.0.Final
Environment: Wildfly 10.1.0 Final
Cent OS 6
JAVA 1.8.0_40
Reporter: Prasanth Reddy
Assignee: Scott Marlow
Priority: Critical
When running the below EJBQL wildfly 10.1.0 throws an exception. The same works fine in
wildfly 9.2.0. I have manually edited the sql below to change the names of tables (so
please ignore if there is an error in the sql). The data types of the columns selected are
the same.
SELECT a.pID FROM Arrangement a WHERE a.pID=30947 AND a.effectiveDate =
'08/21/2001' UNION SELECT e.yID FROM Event e WHERE e.policyID=30947 AND
e.proceedsDate = '08/20/2001'
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: UNION
near line 1, column 86 [SELECT a.pID FROM Arrangement a WHERE a.pID=30947 AND
a.effectiveDate = '08/21/2001' UNION SELECT e.yID FROM Event e WHERE
e.policyID=30947 AND e.proceedsDate = '08/20/2001']
at
org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74)
at
org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:288)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:187)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76)
at
org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150)
at
org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302)
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240)
at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1894)
at
org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:291)
... 89 more
Thanks,
Prasanth
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)