-->
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 modified properties only ?
PostPosted: Fri Sep 09, 2005 2:15 pm 
customer object
public class customer
Code:
{
   private int _CustomerID;
   private string _Ad;
   private string _Email;

   //public properties comes here
}



there is a customer record in database which customerID is 1.
and i want to update only email adres of the customer1.
i am using asp.net and i don't want to get (select) the object before update the email address bu below code block is not work.

Code:
CustomerRepository cr = new CustomerRepository();
Customer c = new Customer();
c.CustomerID = 1;
c.Email= "customer1@newemail.com";
cr.Save(c);


are there any resolution.

i think nhibernate can follow the properties and when i am updating it will update only properties which are setted to a new value (set block executed)


Top
  
 
 Post subject:
PostPosted: Sat Sep 10, 2005 8:58 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You can use ISession.Save*() methods only on fully filled entities!
And most of the time, it is not an issue if you enable lazy loading...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2005 4:29 pm 
i am an asp.net developer.
and my very big drawback with NHibernate is that issue.
When saving and deleting i need to the instance of the object.
i think i can delete with id and i can save only changed properties.

i hope these are get by you as a suggestion.

however i love this tool:)


Top
  
 
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.