Doug,

That is what I am leaning towards. I think I may use this in conjunction with idea that Peter offered.  Is there a record.insert() method? I did not see one.

Thanks,

Josh

------------------------------------------------

Joshua Scott

Resonant Media Technologies, LLC.

www.resonantmedia.com | blog.resonantmedia.com

 

"It is impossible to get out of a problem by using the same type of thinking that it took to get into the problem." -- Albert Einstein

 

 



Doug Hughes wrote:

Why not override the save method on the Record to call insert each time and not save on the DAO?

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Brad Haas
Sent: Thursday, October 12, 2006 7:00 PM
To: [email protected]
Subject: Re: [Reactor for CF] Cloning a Record

 

I agree with Peter.  However, since you've probably built some kind of logic to set the PK to zero--you could probably use the same logic to create a new instance and copy.  

 

Having said that, I think in the long run you're better off with Peters advice, especially in a CMS.  These types of work arounds usually snow ball into a very messy code base.

 

Good Luck,

Brad

 

 

 



 

On Oct 12, 2006, at 6:11 PM, Peter Bell wrote:



Hi Josh,

I would think very carefully before using an ORM to implement versioning as most ORMs are designed to think of object identity (ProductID, UserEmail, UUID, whatever). In a versioning system you have both object identity and version identity within the object identity (similar problems arise when you want to have locale specific versions of content). I am not saying you shouldn’t use Reactor for the project, but I’d think through all of the implications of your versioning identity management rules as if you don’t have a lot of complex O-R mapping issues, you may be better off writing a persistence abstraction layer that is natively aware of version identity and handles stuff like deleting all versions if you delete the object and handling promoting of a version if you delete or insert another version and so on.

You could look at wrapping your persistence layer around Reactor – that might actually be a really good approach, but I’d think twice about manually just hacking as per Brads suggestion because there are a bunch of those hacks you’re going to have to put in to handle all of the issues that arise when implementing a versioning system.

Not that the hack is bad per see – it’s probably what I’d do to solve that specific problem, but I think you might run into a bunch of such problems and it may we worth rolling a layer to abstract the handling of identity persistence.

Best Wishes,
Peter



On 10/12/06 5:50 PM, "Brad Haas" <[EMAIL PROTECTED]> wrote:


What if you created a new instance of the object and just copied the data to it with the exception of the primary key.  It may not be pretty, but it may solve your problem.


 
Brad

 

On Oct 12, 2006, at 5:05 PM, Joshua Scott wrote:


 All,
 
 I have a content management system using reactor and modelglue. I am working on version two and one of the features is a revision system allowing people to save drafts of content.
 
 What I need to be able to do is save a PageContent content object and force an insert instead of an update. I thought I could do this by forcing the pkey to 0, but that does not work.
 
 How would I go about this?
 
 Thanks for the help in advance.
 
 Josh
 
 
------------------------------------------------
Joshua Scott
Resonant Media Technologies, LLC.
www.resonantmedia.com <http://www.resonantmedia.com>  | blog.resonantmedia.com
 

"It is impossible to get out of a problem by using the same type of thinking that it took to get into the problem." -- Albert Einstein
 
 
 
   
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

 


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to