BACK TO THE INDEXRETOUR A L'INDEX
xml shemas for JOAFIP
if you must not loose your previous persisted data, exporting and importing data is needed in these cases below:
your class change
your data model have to be change.
alternatively you can change data model on the fly.
The reason is that transient field value are involved in object state, it must be exported to create an object in coherent state when importing.
From first release thru 2.2.2b<minor>
compatible storage format.
This means you can change JOAFIP without needs of export your data before and import after JOAFIP release change.
The release 2.2.2b4 is the first release able to export and import persisted data.
JOAFIP deals by default with newer versions of classes as described below:
If a new field is added to the class, importing an old version will leave the field uninitialized.
If a field is removed from the class, importing an old version that contains the field will cause an exception.
If the old class do not exist, importing an old version will cause a class not found exception.
At file persistence manager creation there is two parameters for data model management:
the data model identifier of stored data model
an input stream on conversion definition.
For more advanced class migrations:
Using import, must have to do custom pre-processing of the XML
before sending it to XStream (for example, with XSLT, DOM ,
SAX, or STAX manipulations).