-->
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: delete(Query) not available on Session interface?
PostPosted: Wed Jun 16, 2004 5:32 pm 
Newbie

Joined: Wed Jun 16, 2004 5:21 pm
Posts: 3
Location: Portland, OR, USA
I am new to Hibernate, but I think I am getting along fairly well for only using it for a week.

I like the idea of storing queries in the *.hbm.xml files, but I can't figure out why I can't call session.delete() using a Query object. All signatures only accept strings.

Thanks!
DeVon


Top
 Profile  
 
 Post subject: Re: delete(Query) not available on Session interface?
PostPosted: Thu Jun 17, 2004 1:33 pm 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
You can pass a string query in the session.delete() methods:

session.delete("from MyClass mc where mc.id = 89");

Christophe

dcjarvis wrote:
I am new to Hibernate, but I think I am getting along fairly well for only using it for a week.

I like the idea of storing queries in the *.hbm.xml files, but I can't figure out why I can't call session.delete() using a Query object. All signatures only accept strings.

Thanks!
DeVon


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 17, 2004 1:46 pm 
Newbie

Joined: Wed Jun 16, 2004 5:21 pm
Posts: 3
Location: Portland, OR, USA
I figured this out before...

The problem is, when using session.getNamedQuery("SomeQueryName"); to retrieve a Query object built from an entry in your .hbm.xml file, you can't then use that Query object to pass to session.delete().

DeVon


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.