-->
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: inserting records using named queries
PostPosted: Thu Jun 09, 2005 1:42 pm 
Newbie

Joined: Thu May 05, 2005 10:22 am
Posts: 8
hi ,
i wanna insert a record using named queries is there any way to do this ?
i tried to insert but its giving me some excep.
how to execute the query ?
can anyone give me sample code to do this..

thanks & regards,
vinay


Top
 Profile  
 
 Post subject: Re: inserting records using named queries
PostPosted: Thu Jun 09, 2005 2:37 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
xxxx wrote:
hi ,
i wanna insert a record using named queries is there any way to do this ?
i tried to insert but its giving me some excep.
how to execute the query ?
can anyone give me sample code to do this..

thanks & regards,
vinay


Queries, named or otherwise, are for Quering data - i.e. returning lists of resulting objects.

Inserts and Updates are handled for you. Populate an object, begin a transaction, session.save(obj) or session.update(obj), tx.commit();

There are plenty of examples of this in the docs.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 4:56 am 
Newbie

Joined: Thu May 05, 2005 10:22 am
Posts: 8
hi ,
thanks for the reply ,
but actaully i have to insert not thru the save or update....
as i have insert manually using named queries or HQL or something else........
as insert in to DB it ll generate a number and assiign for that record ..
thats my crit...
so please help me in out in writing queriy to inserti into DB without using session.save or session.update or something......
i can use session.save but....

as i shd not use save .....
i need to insert thru only queying .........

thanks

vinay.


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.