Hello guys,
at first I have to say: I'm completly new in Hibernate, so please be patient :)
I'm using a Hibernate Session inside a EJB 3.0 Container. This Hibernate session is calling a procedure which simply insert some data into a table with following structure:
Code:
ID (primary key)
val1 (primary key)
val2 (primary key)
val 3
val 4
I'm calling the stored procedure out of my DAO like this:
Pseudo:
Code:
Session session = super.getSession();
String query = "call myProdcedure(String)";
session.createSQLquery(query);
My stored procedure is parsing the given String and trys to insert the values into the table.
Sample values:
Quote:
"200002","20061001281","Production-Storage-Customer","100"
"200002","20061001283","Dry-Expansion","100"
"200002","20061001283","Fined-Tube","46"
"200002","20061001283","Tube-Wall","10"
"200002","20061001283","Two-Phase","6"
"200002","20061001285","General-Block","100"
"200002","20061001285","Multi-Server","20
Now hibernate is throwing a exception like:
Quote:
"200002","20061001283","Dry-Expansion","100" duplicate entry for key1
The table is completly empty. I checked It several times.
The funny thing is, that Hibernate is accepting the first row without any problems.
It seems that hibernate is not recognizing that the 3 primary key belong together .
I tried to execute the procedure directly in my MySQL Query Browser with sucess. It's working fine and It's inserting the data just like I want.
I guess that I'm calling the procedure _not_ the right way. I've read someting about mapping the procedure in the net but It really confused me couze all examples was read-only functions and I'm JUST writing. I don't need a return-value either....
Hope anybody can help me.
I can post tomorrow morning more details like my mapping,DAO,procedure etc. but If anyone has any hint, I would be very thankfull.
Thank you _very much_ in advance
Your truly
MrDiplomaThesisPanic ;)