• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing Union All in hibernate

 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SELECT LSEO.SEOID AS SEOID, SEO.SEOID AS WWSEOID, SEO.PARNTMACHTYPE AS PARNTMACHTYPE, SEO.PARNTMOD AS PARNTMOD, SEO_CONFIG.FEATURE AS FEATURE, SEO_CONFIG.CONFQTY AS CONFQTY
,'W' as LOCALIND,'HW' as HWIND
FROM <dbschema>.LSEO LSEO, <dbschema>.SEO SEO, <dbschema>.SEO_CONFIG SEO_CONFIG WHERE SEO.SEOID = LSEO.WWSEOID AND SEO_CONFIG.SEOID = SEO.SEOID
union all
SELECT LSEO.SEOID AS SEOID, SEO.SEOID AS WWSEOID, SEO.PARNTMACHTYPE AS PARNTMACHTYPE, SEO.PARNTMOD AS PARNTMOD, SEO_SW_CONFIG.FEATURE AS FEATURE, SEO_SW_CONFIG.CONFQTY AS CONFQTY ,'W' as LOCALIND,'SW' as HWIND
FROM <dbschema>.LSEO LSEO, <dbschema>.SEO SEO, <dbschema>.SEO_SW_CONFIG SEO_SW_CONFIG WHERE SEO.SEOID = LSEO.WWSEOID AND SEO_SW_CONFIG.SEOID = SEO.SEOID
union all
SELECT LSEO.SEOID AS SEOID, SEO.SEOID AS WWSEOID, SEO.PARNTMACHTYPE AS PARNTMACHTYPE, SEO.PARNTMOD AS PARNTMOD, LSEO_CONFIG.FEATURE AS FEATURE, LSEO_CONFIG.CONFQTY AS CONFQTY ,'L' as LOCALIND,'HW' as HWIND
FROM <dbschema>.LSEO LSEO, <dbschema>.SEO SEO, <dbschema>.LSEO_CONFIG LSEO_CONFIG WHERE SEO.SEOID = LSEO.WWSEOID AND LSEO_CONFIG.SEOID = LSEO.SEOID
union all
SELECT LSEO.SEOID AS SEOID, SEO.SEOID AS WWSEOID, SEO.PARNTMACHTYPE AS PARNTMACHTYPE, SEO.PARNTMOD AS PARNTMOD, LSEO_SW_CONFIG.FEATURE AS FEATURE, LSEO_SW_CONFIG.CONFQTY AS CONFQTY ,'L' as LOCALIND,'SW' as HWIND
FROM <dbschema>.LSEO LSEO, <dbschema>.SEO SEO, <dbschema>.LSEO_SW_CONFIG LSEO_SW_CONFIG WHERE SEO.SEOID = LSEO.WWSEOID AND LSEO_SW_CONFIG.SEOID = LSEO.SEOID






How to implement the above query in HIberante.as Hiberante Does not support Union All functioanlity.

Thanks in advance
Swapna
 
Vicky Vijay
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Try using

..createSQLQuery

I hope this should resolve your problem.
 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have used but no use
 
Vicky Vijay
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what problem your are facing ?!

Please provide the details in detail
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic