-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Is hql parsing dialect-specific?
PostPosted: Wed Feb 26, 2014 6:55 am 
Newbie

Joined: Wed Feb 26, 2014 6:42 am
Posts: 1
Hi,

I'm working on a migration for an existing application from MySQL to Oracle. When I use any of the Oracle dialects I get a parsing error while hibernate chews on the named queries.

TheQuery:
Code:
INSERT INTO object_name_one (property_name_one) SELECT DISTINCT o.property_name_two FROM object_name_two o WHERE some_id = :another_id


TheException:
Code:
ERROR org.hibernate.impl.SessionFactoryImpl  - Error in named query: queryname
org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: DISTINCT near line 3, column 59 [
   
       INSERT INTO object_name_one (property_name_one) SELECT DISTINCT o.property_name_two FROM object_name_two o WHERE some_id = :another_id
     
   ]
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
   at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
   at org.hibernate.hql.ast.exec.BasicExecutor.<init>(BasicExecutor.java:67)
   at org.hibernate.hql.ast.QueryTranslatorImpl.buildAppropriateStatementExecutor(QueryTranslatorImpl.java:558)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:201)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)


That leaves me wondering why this is a parser error. Is the hql language dependend on specific target plattforms? I always thought the point was to be independend of the target database.

Does this mean i have to change my hql query to run on oracle or might this be a bug?


Any help is appreciated....


kind regards,

Jason


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.