Re: [Hibernate] updating exiting objects with a new clone

2003-11-03 Thread Gavin King
From: "Gavin King" <[EMAIL PROTECTED]> To: "Troy McKinnon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 8:45 PM Subject: Re: [Hibernate] updating exiting objects with a new clone Oh, P.S. perhaps what you are looking for

Re: [Hibernate] updating exiting objects with a new clone

2003-11-03 Thread Troy McKinnon
From: "Gavin King" <[EMAIL PROTECTED]> To: "Troy McKinnon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 8:45 PM Subject: Re: [Hibernate] updating exiting objects with a new clone > Oh, P.S. perhaps what you are lookin

Re: [Hibernate] updating exiting objects with a new clone

2003-11-02 Thread Gavin King
Cheers Troy - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: "Troy McKinnon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 8:09 PM Subject: Re: [Hibernate] updating exiting objects with a new clone G I

Re: [Hibernate] updating exiting objects with a new clone

2003-11-02 Thread Gavin King
don't see a problem with having Hibernate 'check' if it exists and USE this object as if it had been loaded. Cheers Troy - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: "Troy McKinnon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTE

Re: [Hibernate] updating exiting objects with a new clone

2003-11-02 Thread Troy McKinnon
MAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 8:09 PM Subject: Re: [Hibernate] updating exiting objects with a new clone > G I hate this. I think it almost always indicates that you are > using Hibernate "wrong". You should be able to do the

Re: [Hibernate] updating exiting objects with a new clone

2003-11-02 Thread Troy McKinnon
I will do that. Just seems like a lot of overhead. Especially on an large dataset with a lot of rows. Troy - Original Message - From: "David Rees" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 8:08 PM Subject: Re: [Hibernate] updating

Re: [Hibernate] updating exiting objects with a new clone

2003-11-02 Thread Gavin King
G I hate this. I think it almost always indicates that you are using Hibernate "wrong". You should be able to do these kind of things using saveOrUpdate(); thats what its there for. Get the object in the /previous/ transaction, set its state, and then call saveOrUpdate(). Now, I can incred

Re: [Hibernate] updating exiting objects with a new clone

2003-11-02 Thread David Rees
Troy McKinnon wrote: > The only way I can see doing this now is to transfer the field values > from myItem to fromDatabase. > (Note: using the reflect package to do this is fairly trivial - but just > more work ) > If there was some way to updateSimilar or updateFromClone or similar > method that

[Hibernate] updating exiting objects with a new clone

2003-11-02 Thread Troy McKinnon
  http://forum.hibernate.org/old/914765.html talks around the issue I amhaving but it doesn't really solve anything.     We start with an object manually created.  >>    MyItem myItem = new MyItem(id, name, desc);   I then check to see if it already exists.  To determine if I want to do an