Skip to main content

jpa hibernate problem

No replies
carek
Offline
Joined: 2009-10-15

Hi.

I have been asigned to write a simple module to my project and I'd like to start with simple unit test... well I'm stuck. Here's the thing:

I'd like to do something like this:
http://www.java2s.com/Code/Java/JPA/NativeInsertStatementWithParameter.htm
, so I would like to insert some objects into db. However I would like to do it by stored procedure and by persist method of entity manager. Is it possible?
Can someone give an example how to do that? let's say on an db with one table on one class. what annotations will I need? How would @SQLInsert look like?
I have some code, but it doesn't work. (db and stored procedure is good - i can fire it from db manager and it adds a row to the table)
(I am using ms server 2008)

thanks a lot in advance