My situation is as follows. 1. I have a class (Foo.java) that has been working nicely for some time and I have many instances serialized to JSON. 2. I need to change Foo.java in a way that is incompatible with the old serialized from, and need to be able to read in the old form an migrate to the new in a transparent fashion.
I can think of some approaches for this, but wonder if there is any built in support for this, or any good patterns to follow. My JSON is stored in a database, so most obviously I could: 1. add a version number column to the table, and set all the old versions to version 1 2. keep the old versions of the classes around, putting them in an "obsolete", and replace the originals with new versions of the classes 3. look first at the version number, and if version 1 then deserialize the old way, migrate to the new version as save as version 2 4. if version 2 then deserialize the new way Thanks Tim -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
