standalone sync plugin [message #50980] |
Fri, 17 October 2008 07:11 |
Eclipse User |
|
|
|
Originally posted by: lifemikey.gmail.com
I'd like to write a headless plugin to sync my data model with the
current DB.
For a plugin to work does the eclipse application need to be running or
is there a way to create a standalone plugin that just references some
jar files and does some action?
I would be using these types of classes to traverse the EMF model:
import org.eclipse.wst.rdb.internal.core.definition.DataModelElemen tFactory;
import org.eclipse.wst.rdb.internal.core.definition.DatabaseDefinit ion;
import
org.eclipse.wst.rdb.internal.models.sql.datatypes.CharacterS tringDataType;
import org.eclipse.wst.rdb.internal.models.sql.datatypes.DataType;
import org.eclipse.wst.rdb.internal.models.sql.schema.Database;
import org.eclipse.wst.rdb.internal.models.sql.schema.SQLObject;
import org.eclipse.wst.rdb.internal.models.sql.schema.Schema;
import org.eclipse.wst.rdb.internal.models.sql.tables.Column;
import org.eclipse.wst.rdb.internal.models.sql.tables.SQLTablesPack age;
import org.eclipse.wst.rdb.internal.models.sql.tables.Table;
Similiar to the traverse plugin mentioned here:
http://www.ibm.com/developerworks/db2/library/techarticle/dm -0807liu/
Thanks,
Mike
|
|
|
Re: standalone sync plugin [message #51009 is a reply to message #50980] |
Fri, 17 October 2008 17:20 |
Eclipse User |
|
|
|
Originally posted by: brianf.sybase.com
Hi Mike
That's an interesting use case. Can you provide some additional details?
It sounds (based on your description) that you're modifying the EMF Model
outside of the DTP tooling and then want a way to "push" those changes back
to the database. Is that a good summary?
You can definitely use the DTP code in a headless fashion, though I'm not
quite sure how do the syncing back to the original database.
Sounds like we'd need some kind of way to compare the external EMF model to
the model loaded at runtime, get the differences, generate DDL to make the
changes to the in-database objects, and apply the DDL.
Not sure we've really done that kind of thing yet, but it certainly sounds
like an interesting application of the DTP APIs.
If you could provide some additional details, maybe we can provide some
additional guidance.
--Fitz
"Mike Lamb" <lifemikey@gmail.com> wrote in message
news:gd9drs$gen$1@build.eclipse.org...
>
> I'd like to write a headless plugin to sync my data model with the current
> DB.
>
> For a plugin to work does the eclipse application need to be running or is
> there a way to create a standalone plugin that just references some jar
> files and does some action?
>
> I would be using these types of classes to traverse the EMF model:
>
> import
> org.eclipse.wst.rdb.internal.core.definition.DataModelElemen tFactory;
> import org.eclipse.wst.rdb.internal.core.definition.DatabaseDefinit ion;
> import
> org.eclipse.wst.rdb.internal.models.sql.datatypes.CharacterS tringDataType;
> import org.eclipse.wst.rdb.internal.models.sql.datatypes.DataType;
> import org.eclipse.wst.rdb.internal.models.sql.schema.Database;
> import org.eclipse.wst.rdb.internal.models.sql.schema.SQLObject;
> import org.eclipse.wst.rdb.internal.models.sql.schema.Schema;
> import org.eclipse.wst.rdb.internal.models.sql.tables.Column;
> import org.eclipse.wst.rdb.internal.models.sql.tables.SQLTablesPack age;
> import org.eclipse.wst.rdb.internal.models.sql.tables.Table;
>
>
> Similiar to the traverse plugin mentioned here:
> http://www.ibm.com/developerworks/db2/library/techarticle/dm -0807liu/
>
> Thanks,
> Mike
|
|
|
Re: standalone sync plugin [message #51040 is a reply to message #51009] |
Fri, 17 October 2008 19:23 |
Eclipse User |
|
|
|
Originally posted by: lifemikey.gmail.com
> It sounds (based on your description) that you're modifying the EMF
Model
> outside of the DTP tooling and then want a way to "push" those
changes back
> to the database. Is that a good summary?
>
Actually the other way.
I'm using the Rational Data Architect (DTP) tools for DB documentation.
When the DB schema changes I want to run a headless program to sync the
schema changes with the EMF model in Rational Data Architect.
Example 1:
In Table1 a new column was added:
Table1
NEWCOLUMN INTEGER NOT NULL
Example 2:
In Table1 COLUMN1 changes from INTEGER to BIGINT
Where would I find information on how to use DTP in a headless way?
I would want to add this to a schema creation process to make sure the
EMF model is in sync with the schema.
Thanks,
Mike
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04391 seconds