|Re: Is there a smart way to adjust/use the EMF code generator for instances of my ecore model? [message #629821 is a reply to message #629765]
||Wed, 29 September 2010 16:06
| Ed Merks
Registered: July 2009
Please uses the EMF newgroup/forum (eclipse.tools.emf) for questions
More comments below.
Bernd Vogt wrote:
> currently, I'm playing with a lite Android project that uses the build
> in SQLite database of Android. I like Android and SQLite mutch, but
> when I introduce a new SQLite table I have to write a lot of
> boilerplate code (Java constants for table names, column names,
> create/drop/insert statements and so on).
> Now, I'm thinking about to unleash the power of modeling. I have a
> little SQLite model (sqlite.ecore) to define database schmeas. For
> that schemas I want to generate the boilerplate code.
> Unfortunately, I'm to lazy to implement the whole code gegeration for
> my SQLite models on my own and I'm spoiled by the cool features of the
> EMF code generator like 'merge' and 'dynamic templates'.
JMerge is separate reusable thing. Dynamic templates are possible too.
> Is there a smart way to adjust/use the EMF code generator in a way
> that he produces code for instances of my SQLite model?
I doubt it. EMF's code generator is driven by GenModel and Ecore
instances. SQLLite instances just aren't going to feed through. You
might try mapping your SQLLite instances to Ecore and the modify the
templates that produce code from Ecore; i.e., do something not unlike
how we make XML Schema instances to Ecore instances and then generate
Java that acts to implement the original schema's API and serialization.
> Kind regards,
Powered by FUDForum
. Page generated in 0.02299 seconds