-->
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: how do you create updates and inserts in in native queries
PostPosted: Fri Jan 12, 2007 4:57 pm 
Newbie

Joined: Fri Dec 15, 2006 5:49 pm
Posts: 16
do you have to add a native query to an entity as follows and how do you do update inserts and deletes in native quesries in hibernate

Query query = session.createSQLQuery(sql).addScalar("stdErr",Hibernate.DOUBLE).
addScalar("mean",Hibernate.DOUBLE);
//Double [] amount = (Double []) query.uniqueResult();
Object [] amount = (Object []) query.uniqueResult();
System.out.println("mean amount: " + amount[0]);
System.out.println("stdErr amount: " + amount[1])


List insurance = session.createSQLQuery("select {ins.*} from insurance ins")
.addEntity("ins", Insurance.class)
.list();


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 13, 2007 12:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
read the docs or please be a bit more specific since you seem to already have answered your own question ;)

_________________
Max
Don't forget to rate


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.