Hi Nathan, On 27 Nov 2007 at 11:23, Nathan Anderson wrote:
> I've done archiving another way that worked pretty well. Basically at the > time you save the object you also create a new archive entry. Seems a bit > simpler than the approach you described. Yes, that seems a good lateral solution to the problem. The downside (having one more archive record than you really need) is not too bad. My only problem with that approach is that I'm hoping also to add a bit of selectivity to the archive process, for example not storing an archive record when nothing has changed compared with the previous version. This would help prevent the archives filling up with redundant records from users who click "save" instead of "close" or "cancel" after they've taken a look at a record. > ----- "Rob Hills" <[EMAIL PROTECTED]> wrote: > > Using AppFuse 2.0 + Struts 2 + Hibernate > > > > I need to maintain archived versions of some of my entities. The > > pattern I'd > > like to implement involves saving a copy of the old version of an > > entity (to > > another table) just prior to persisting any updates to the entity. > > > > In the save(xx) method of my manager, before saving, I do a "get()" > > with the > > object's ID into a separate entity object with the idea that this > > would give me > > the old version from the database. However, it's actually returning > > the > > updated "dirty" version of the entity. I guess this makes sense, > > because I'm > > using the same manager. > > > > My question is, how do I go about getting the old version of the > > entity at this > > point? Cheers, Rob Hills Waikiki, Western Australia Mobile +61 (412) 904-357 Fax: +61 (8) 9529-2137 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
