Differences between revisions 2 and 3
Revision 2 as of 2013-07-19 12:37:13
Size: 1694
Comment:
Revision 3 as of 2013-08-23 09:05:49
Size: 2348
Comment: Added section about new name convention for schema and tables in csv and fixedwidth modules
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:

== New schema/table name convention for CSV and Fixed Width file DataContexts ==

With Apache !MetaModel we've introduced a new naming convention for schemas and tables from the 'csv' and 'fixedwidth' modules. This may impact your application if it is referring schema or table names of such !DataContexts.

The ''old'' convention was:
 * Schema name: Same as the filename. Example: "data.csv"
 * Table name: The filename without the last 4 characters (the file extension). Example "data"

The ''new'' convention is:
 * Schema name: The directory/folder name of the file. Example "documents".
 * Table name: The filename. Example "data.csv"

Migrating from eobjects.org MetaModel

In it's previous incarnation, MetaModel was hosted and developed not at Apache, but at http://metamodel.eobjects.org. With the move to Apache, we're also changing the namespace of MetaModel to org.apache.metamodel instead of org.eobjects.metamodel. Obviously this causes migration issues, but on this page is a compilation of tips to overcome them.

Quick migration: Search/replace

If you're a light user of MetaModel, then probably a quick search/replace in your .java files will do the trick. Here's the common things to search for and replace with

Search for

Replace with

import org.eobjects.metamodel

import org.apache.metamodel

import static org.eobjects.metamodel

import static org.apache.metamodel

A broader search for org.eobjects.metamodel should also provide a good final check to see if you've missed any devils in the details.

New schema/table name convention for CSV and Fixed Width file DataContexts

With Apache MetaModel we've introduced a new naming convention for schemas and tables from the 'csv' and 'fixedwidth' modules. This may impact your application if it is referring schema or table names of such DataContexts.

The old convention was:

  • Schema name: Same as the filename. Example: "data.csv"
  • Table name: The filename without the last 4 characters (the file extension). Example "data"

The new convention is:

  • Schema name: The directory/folder name of the file. Example "documents".
  • Table name: The filename. Example "data.csv"

Deserializing legacy MetaModel objects

If you've been relying on serialization of MetaModel objects from the legacy codebase, you will encounter troubles when deserializing them. To alleviate this issue we provide a specialized ObjectInputStream class that transparently deserializes legacy objects into their new format. This class is called LegacyDeserializationObjectInputStream.

Here's a simple example of it's usage:

   1 Object obj;
   2 FileInputStream fileIn = new FileInputStream("my_legacy_metamodel_object.ser");
   3 try {
   4     ObjectInputStream ois = new LegacyDeserializationObjectInputStream(fileIn);
   5     obj = ois.readObject();
   6     ois.close();
   7 } finally {
   8     FileHelper.safeClose(fileIn);
   9 }

MigratingFromEobjectsMetaModel (last edited 2013-08-23 09:05:49 by KasperSorensen)