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.  [ 1 post ] 
Author Message
 Post subject: Update a relational property without loading entity
PostPosted: Wed Sep 13, 2006 6:50 am 
Newbie

Joined: Tue Sep 12, 2006 8:12 am
Posts: 1
Hi All;

I am new in this forum. I use Castle ActiveRecord (based NHibernate) for my new project.

The question: When updating a relational property of an entity, I must load the relational entity from DB. But I want to update it with id of entity. For example:

Code:
Employee e = Employee.Get(employeeId);
e.Company = Company.Get(newCompanyId); // loads company from DB
e.Update();


Can I update Company property of employee with companyId?


Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.