-->
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.  [ 2 posts ] 
Author Message
 Post subject: Need stored procedure to delete mutable entity type?
PostPosted: Tue Apr 17, 2007 3:42 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
I have marked a particular class/table as mutable, because the business logic dictates that this historical row can never be updated. This gives me some 2nd level cache dirty-checking optimisation and makes the intention of my code, clearer.

<class name="FooHistory" table="FooHistory" mutable="false">

Now, I need to delete all data from all of my tables for user testing purposes. I'd like to essentially bypass the mapping restriction and just issue a plain SQL delete statement.

I thought this would be easy peasy, but maybe Hibernate is right to make this either difficult or outright forbid it.

I can't find anything in the documentation that will execute a plain delete statement without any regard to the mapping or types. Am I right in thinking that I must use a stored procedure here?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 4:26 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Just use ADO.NET, you don't need NHibernate for this. Use ISession.Connection to get the ADO.NET connection.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.