I have a similar solution in my job. I've done in the following way:

class A {
...
}

class A_normal extends A {
}

class A_history extends A {
}

Only A_normal and A_history are mapped in repository.xml.

So, if I need to manipulate the object, I use class A. To store a normal object, I use 
and
instance of A_normal. If I need to store a history object, I use A_history. Now, if I 
need
to move one object A_normal to A_history, I use the method copyProperties in 
common-beans
library to do the job. The I start a transaction, delete A_normal and insert the 
A_history.

I think can be several ways to get job done, this is just one.

Best regards,

Richter

> My application has to support undo using persistence, as someone must be able to 
> change a
> previously entered field after closing and re-opening the application.
>
> All of my classes extend my own PersistentObject class, but certain classes can be 
> entered
> into the "History" (to be undone later), and those classes implement a marker 
> interface
> called "Enterable".
>
> I'd like to have two methods as follows:
>
> store(PersistentObject)
> storeEnterable(Enterable)
>
> where storeEnterable() would store the Enterable in a history table. Is this 
> possible?
>
> --
> Liam Morley
> [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to