-->
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: how can i pass the values for <sql-insert>
PostPosted: Tue Mar 13, 2007 2:04 am 
Beginner
Beginner

Joined: Tue Dec 12, 2006 7:52 am
Posts: 20
Hi
I am writing the code in hbm file like this

<sql-insert>
insert into stud (sno, name, fname, address, state, designamtion) values (null, ?, ?, ?, ?, ?)
</sql-insert>

where can i pass the values for above query pleaz any one can help me
please send sample code also of on scenario i have doubts on <sql-delete> and <sql-update> please help me as early as possible


Top
 Profile  
 
 Post subject: hi
PostPosted: Tue Mar 13, 2007 4:41 am 
Newbie

Joined: Tue Mar 13, 2007 4:15 am
Posts: 12
Location: Trivandrum
If u r using <sql-insert> u have to persist the object using session.save(obj)

it will directly execute the sql statement insted of using SQL dialect

_________________
Regards
Belto


Top
 Profile  
 
 Post subject: <sql-insert>
PostPosted: Tue Mar 13, 2007 5:55 am 
Beginner
Beginner

Joined: Tue Dec 12, 2006 7:52 am
Posts: 20
Hello sir

I know that but can u set the values for that abject
suppose you the example
Stud stud=new Stud();
stud.setSno(123);
stud.setName("XXXXX");
Stud.setFName("YYYYYYYYYY");
................
....................
session.save(stud);
this is enough for that
i am asking for this insert
we write the Query inside the hbm file by using
<sql-insert>
insert into stud (sno, name, fname, address, state, designamtion) values (null, ?, ?, ?, ?, ?)
</sql-insert>
how can we pass the values for this query


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.