-->
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.  [ 4 posts ] 
Author Message
 Post subject: Query Delete
PostPosted: Tue May 11, 2004 8:28 am 
Beginner
Beginner

Joined: Tue May 11, 2004 8:24 am
Posts: 23
Hi,

I need to fire SQL "DELETE" Statements from our Application. I would most preferably do this using NamedQuerys.

This is not possible currently right?
Is the a timescale of this feature?
Is there an alternative way how to do this?

Maybe anyone can explain to me how to fire a direct JDBC-Query using the Hibernate Session Connections?

Regards,

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 11:05 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
For that purposes I use Session's method
Quote:
public int delete(String query) throws HibernateException
Delete all objects returned by the query. Return the number of objects deleted.


where query is an ordinal HQL select query.

http://www.hibernate.org/hib_docs/api/net/sf/hibernate/Session.html#delete(java.lang.String)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 11:09 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
To execute low-level SQL queries use Session.createSQLQuery(..) methods.


Top
 Profile  
 
 Post subject: Thank you.
PostPosted: Wed May 12, 2004 3:07 am 
Beginner
Beginner

Joined: Tue May 11, 2004 8:24 am
Posts: 23
that helped me.

Regards,

Alex


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