• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can i use Hibernate for temporary tables

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hibernate version:2.0

My business rules are complex.

we are joining 2 or more tables, then putting the resultset into a temporary table. then performing some operations on the temporary table -- we are again joining the resultset from the above operations to other tables.
-- currently we are usings SPs for this purpose.

How can i acheive this in Hibernate?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


currently we are usings SPs for this purpose


Upgrade to vearion 3.0. You can map Stored Procedures as named queries in that version.

No version of Hibernate can map to temporary tables (I don't know any ORM that can), since temporary tables are not strictly part of your data model. They are transient, you may as well be trying to map to a specific piece of data.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Abhi Shetty:
Hibernate version:2.0

My business rules are complex.

we are joining 2 or more tables, then putting the resultset into a temporary table. then performing some operations on the temporary table -- we are again joining the resultset from the above operations to other tables.
-- currently we are usings SPs for this purpose.

How can i acheive this in Hibernate?



Depending on the complexity, it might be possible to avoid a temporary table by using table expressions (in DB2). Though it is called something else in other RDBMS, iam sure every RDBMS supports that. So if that would work, then all can be done in one SQL. With right indexes, it will work fine as well. Then you can use Hibernate the usual way without having to worry about temporary tables.
 
reply
    Bookmark Topic Watch Topic
  • New Topic