-->
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 to update multiple rows value through one query in hql
PostPosted: Sun Sep 13, 2009 4:15 am 
Newbie

Joined: Mon Aug 31, 2009 1:45 am
Posts: 12
please advice me how to update multiple rows through

getHibernateTemplate().update(Pojo Object)


Top
 Profile  
 
 Post subject: Re: how to update multiple rows value through one query in hql
PostPosted: Sun Sep 13, 2009 10:36 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Well, if the object references a collection, and those elements have changed, multiple rows will be updated. It's as easy as that!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: how to update multiple rows
PostPosted: Sun Sep 13, 2009 11:29 am 
Newbie

Joined: Mon Aug 31, 2009 1:45 am
Posts: 12
our object reference is not collection , we took all properties as a list
below is the code

please advice how to update director information on the below code or should we move through object reference collection

Code:

public class Company implements Serializable

{
            private int companyid;
             private List<Director> dchinesename;
   private List <Director> denglishname;
   private List <Director> daddress;
   private List <Director> dcity;
   private List <Director> dstate;
   private List <Director> dzipcode;
   private List <Director> dcountry;
   private List <Director> demail;
   private List <Director> dcompanyno; 
   
}

public class CompanyDTO {
   
   private int companyid;
             private List dchinesename;
   private List denglishname;
   private List daddress;
   private List dcity;
   private List dstate;
   private List dzipcode;
   private List dcountry;
   private List demail;
   private List dcompanyno;

}

public class Director {
   
   
   private int directorid;
   private String dchinesename;
   private String denglishname;
   private String daddress;
   private String dcity;
   private String dstate;
   private String dzipcode;
   private String dcountry;
   private String demail;
   private String dcompanyno;

}

public class DirectorDTO {
   
             private int directorid;
   private String dchinesename;
   private String denglishname;
   private String daddress;
   private String dcity;
   private String dstate;
   private String dzipcode;
   private String dcountry;
   private String demail;
   private String dcompanyno;

}


   


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.