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:

The new convention is:

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)