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: creating object revisions
PostPosted: Wed Dec 27, 2006 11:52 pm 
Newbie

Joined: Tue Jun 20, 2006 11:51 am
Posts: 14
Given the following:

- Spring 1.2.8 (using Spring MVC)/Hibernate 3.1.3
- A QuestionMaster class containing a List of Question objects with the List index field/column “revision” (bidirectional parent/child)
- A Survey class with a List of Question objects with the List index field/column “questionNumber” (unidirectional with join table)

When editing questions, I want to detect if/when changes to a Question are made and create a new revision (i.e. new Question object that is then added to the QuestionMaster Question List) and replace the corresponding Survey Question with the new revision.

I was thinking that I could create a method in the manager/service class that tests Session.isDirty() to determine if changes were made and then create a new Question/add it to the QuestionMaster List/etc. The problem with this strategy is that I would need to cancel the changes to the original Question in the current persistence context and I’m not sure how to do that.

Any advice/suggestions?

Thanks,
Gary


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.