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