company logo

ObjectSpace :: exportData - Export data

The function exports data stored in the object space and all its subordinated object spaces. Data can be exported in CSV, ESDF, XML or OIF format.

Data is exported to the file location passed in sFilePath. The export format type will be derived from the file extension. The extension .xml causes export to create an XML file, an extension .oif will cause an OIF export, while .csv and .esdf cause creating an CSV or ESDF file format. Since CSV and ESDF files do not contain property and type tags, those cannot be re-imported.

Data is exported for all extents. Owning extents export complete instances, not owning extents will export instance attributes or instance references by main access key (depending on the copy type used).

CSV and ESDF are untagged formats and thus, limited in use. Typically, CSV is used for internal string representations of key values and for data import. ESDF is the default format for instance string representations, since it supports reference collections (in contrast to CSV).

In order to run exhaustive data exchange processes, OIF is suggested, which provides all information for exporting a complete data base and reimporting it, again. OIF is a tagged standard format suggested by ODMG for complex data initialization.

XML is suggested for exporting data to other target systems, which do not understand OIF.

Notes:

When running import/export in a client/server environment, the file name passed in sFilePath has to be a symbolic file name which is defined in the file catalog on client and server side. The export/import is executed on server. The result is transferred finally to the client location defined in the client's file catalog.

Implementation overview

Implementation details

  1. Export all data
    ObjectSpace  :: exportData ( odaba::String &sFilePath )

    The function exports the complete object space to the file passed in sFilePath. The copy created contains all information for recreating a database with the same content in another file. This function call does same as export data with copy type CopyAll.

    • sFilePath - Complete file path
  2. to list
  3. Export data according to copy type
    ObjectSpace  :: exportData ( odaba::String &sFilePath, odaba::CopyTypes eCopyType )

    The function exports object space data to the file passed in sFilePath. The amount of data exported can be controlled by the copy option passed in eCopyType.

    For copying all data of an object space in a consistent manner, i.e. in a way that it can be re-imported into another database, CopyAll or CopyDeep has to be passed. In this case, all object instance in owning collections are copied with all instances owned by the object type (references and owning relationships) as well as instance data (attributes) for all primary relationships. Instance data for secondary relationships is not copied, since secondary relationships are maintained automatically, when loading the database. In order to provide additional link information for secondary relationships too, locators will be exported in addition.

    CopyModel exports data as being defined in the copy model.

    Passing CopyInstances in eCopyType will copy instance data (attribute values) for all instances without copying referenced instances. CopyInstances is set implicitly when exporting data to CSV.

    Passing CopyLocal will export attribute values for all instances and and all instances referenced in owning collections (references, owning relationships and generic attributes).

    Passing CopyRelationships exports instances and owned instances (as CopyLocal). In addition, locators (position or order key values) are exported for all not owning relationships.

    In order to copy sufficient data for reimporting exported instances, CopyAll should be passed. This option causes exporting instances and owned instances (as CopyLocal). In addition, key component attribute values are exported for all referenced instances in primary not owning relationships.

    In contrast to CopyAll, CopyDeep copies all attribute values for all instances referenced in not owning relationships.

    CopyModel exports attribute values for instances. Data referred to in references and relationships is copied as being defined in the copy model, i.e. copy options selected for for references and relationships.

    • sFilePath - Complete file path
    • eCopyType - Copy type

      The copy type defines the amount of data to be copied or exported.

  4. to list