-->
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: Truncate Tables
PostPosted: Mon Oct 06, 2008 10:45 am 
Newbie

Joined: Mon Oct 06, 2008 10:40 am
Posts: 12
Hibernate Version: Unknown
Database: Oracle

I am looking into how to truncate a table through a session call.

I have tried:
Code:
session.createQuery("DELETE FROM TableName").executeUpdate();


And also replaced DELETE with TRUNCATE. I keep getting "TableName is not mapped."

I would greatly appreciate any help on this. Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 06, 2008 2:52 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Well ... is TableName mapped?
BTW, truncate is not allowed. AFAIK.

Check your hibernate.cfg.xml, your code, or wherever you map tables to classes.
On your database side, check if there could be a privileges or schema naming problem.

_________________
Gonzalo Díaz


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.