• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate error unexpected token: (

 
Sabeehuddin Hasan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing a hibernate error regarding unexpected token: (.

I am executing the following query.




The error is given right after line left join fetch ot.employee emp,. This query is working fine in SQL. Any help will be highly appreciated.

Regards,
Sabeehuddin Hasan
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest simplifying your query. Basically you are trying to left outer join fetch more than one many table, and you will be left with a cartesian product and an app that hangs because it is bring the whole database down to the query results.

Also the SELECT portion is wrong with SELECT opp, tab. What is tab? (Ah I see a sub-sub-sub query.

So HQL isn't SQL and there are other ways to make subqueries that are easier to do. Right now that query is just too difficult to read to be able to help. I'll let some other people help out if they can.

Mark
 
justin boschetto
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your query is extremely stressful to the db, you could try hitting the db for part of what you need (ie. the tab object , or any arbitrary value need to achieve the proper result) store it, then re-hit the db for the next value. this might not be faster but it will help with debugging and it puts less stress on a single queary that sub query's so many times.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic