• 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

Stored procedures JPA and mappings

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I already asked this question on the Hibernate forum (https://forum.hibernate.org/viewtopic.php?f=1&t=1001537) but it sims there are a very few people answering the questions. So here it goes:

I have a question regarding the stored procedures in JPA. I have the following Entity called RenGaraza which uses two stored procedures "vrniGarazo" and "vrniGarazoPk" that do basically the same thing. The only difference is in the were part of the procedure - the resultSet is the same in both cases.



The stuff works just fine when I call the procedure directly using the first named query - "vrniGarazo":



However, I need to call the same entity via another Entity "RenDelistavb":



I have tried all kinds of mambo-jumbo like adding the ResultSetMapping to the procedure, adding different loader and so on, but could not make it to work.

I get the NullPointerException and if I do some debugging I can see that "com.sun.jdi.InvocationException occurred invoking method." error.
I additionally debuged the procedure that is called in the second case and it sims that it executes correcly even using the correct id from
the RenDelistavb and that it actually generates the resultSet, but it is not returned correctly.

I intensively debugged the hibernate code and found out that the Set<RenGaraza> is initialized correctly but there is an obvious bug
in the procedure since the Set set in the PersistentSet class is not initialized anywhere and as a consequence



produces an error:




I am using the latest version of hibernate (3.4.0.GA)


Now, obviously my question is what am I doing wrong and if it is even possible to call the original clall (RenGaraza ) in the manner I am trying to do it?
If the answer is not, is there any workaround or another solution?


Thanks for the answers.

Regards,
Matej
 
Right! We're on it! Let's get to work tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic