-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate with MSSQL Server and SP
PostPosted: Sun Jul 15, 2012 8:39 pm 
Newbie

Joined: Thu Jul 12, 2012 8:43 am
Posts: 2
Location: Greece
Hello,

on a project we are using Hibernate 3.2 to connect to a MSSQL server. We have established the connection and I can read from the database without any problem.
Now I am trying to write to the database. I must mention that the database structured is defined and I cannot modify it. Now i have create an entity for a database table
that i want to insert rows. I must use stored procedures to implement the insertion. So on the xml I use the
Code:
<sql-insert>
tag to define that Hibernate must use the
stored procedure that exists on the server. My problem (as i believe) is at the mapping of the entity id. The id is generated on the stored procedure. When I use the
Code:
<generator class="native">
I get an exception that the ID cannot be null. As I understand it this is right because Hibernate passes null as an id and lets the server to handle it. When i do not use any generator and i am trying to bind the entity properties to the parameters of the procedure, I get an exception that it cannot bind the values and on the sql code that hibernate generates i see that passes the parameters with the wrong order.

I believe the fault is at the right mapping of the id.I would like to set it so that Hibernate will pass -1 as an id to the parameter of the procedure..
I would appreciate any help, and also if you need me to upload anything else ask me.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Hibernate with MSSQL Server and SP
PostPosted: Mon Jul 16, 2012 7:35 am 
Newbie

Joined: Mon Jul 16, 2012 7:20 am
Posts: 2
http://comm1096blog.rmit.edu.au/oakleysunglasslenses/2012/07/16/musing-about-it-pertaining-to-sunglasses/
http://yourjourneythroughgrief.com/kidsoakleysunglasses/2012/07/16/get-a-look-involving-sunglasses-on-film-visits/
http://oakleysunglassesonline.uintu.com/2012/07/16/picking-out-cool-artist-prescribed-eyeglasses-along-with-sunglasses/
http://agilitys.com/oakleysunglassesformen/2012/07/16/shield-your-eyes-in-style-together-with-polarized-sunglasses/
http://cheapoakleysunglass.blog4u.gr/2012/07/16/sunglasses-are-much-more-on-your-health-and-fitness/
http://oakleysunglassesprices.coolblogz.com/2012/07/16/top-rated-several-why-you-should-acquire-architect-eye-wear/
http://blogsfree.org/oakleysunglasssale/2012/07/15/ray-prohibition-sunglasses-inside-movies/
http://oakleysunglassesaccessories.idiya.me/2012/07/16/eyewear-purchasing-made-easy-together-with-visionspecialists/
http://yourgossip.com/oakleypolarizedsunglasses/2012/07/16/buttocks-search-prominent/
http://oakleywholesalesunglasses.komunitasonline.com/2012/07/16/where-to-bargain-gucci-sunglasses-in-this-particular-summer-time/
http://raybansunglasses.phacker.org/2012/07/16/go-old-style-this-coming-year-along-with-spherical-sunglasses/
http://oakleyfishingsunglasses.blogv2.com/2012/07/16/versace-sunglasses-the-suitable-combination-of-type/
http://oakleysunglassesstores.vs.am/2012/07/16/beam-prohibition-the-domain-name-of-high-quality/
[


Top
 Profile  
 
 Post subject: Re: Hibernate with MSSQL Server and SP
PostPosted: Tue Jul 17, 2012 9:32 am 
Newbie

Joined: Thu Jul 12, 2012 8:43 am
Posts: 2
Location: Greece
anyone ???


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.