4 Replies Latest reply on May 12, 2010 12:29 PM by Leo van den berg

    Versioning entities or business objects

    Craig Bensemann Novice

      While this is not a Seam specific question I would like to hear from the community how others have done this. I need to version entities as they are saved to the database. I'll try and give an example of the things I'm trying to achieve.

      Say I have object A and it has a collection of other objects (B, C, D) so I have: A -> {B, C, D}. Later on a user of the system updates the collection so now it is A -> {B, C, E, F}. What I need to happen is that any report, invoice, etc etc that was created before the collection was changed still sees the old version while anything created after the update sees the new version.

      While this is a simplistic example there are often far more complex data structures involved (large tree structures etc). Has anyone done anything similar? Or used some existing technology to achieve this? I have a couple of ideas how I might go about rolling my own solution here but if there is an existing solution to this type of problem I would rather look into that.