0

This is a query to fetch data from two tables

blogs

and

askquestions

HQL query For following SQL query:

select title , date from (select blog_title as title ,created_date as date from  blog  union select ask_question as title , created_on as date from askquestions ) as aa order by date desc

Thanks in advance for any answers or suggestions!!!

User2413
  • 605
  • 6
  • 22
  • 51

1 Answers1

0

Unions are not supported by hibernate, see How to do a Union SQL statement in HQL?

For an alternative see Hibernate Union alternatives

Community
  • 1
  • 1
StephaneM
  • 4,779
  • 1
  • 16
  • 33
  • Hi StephaneM thanks alot!!can you just tell me how to write a HQL method in DAo implementation???thanks in advance.. – User2413 Feb 18 '14 at 13:29