standalone sync plugin [message #50980] |
Fri, 17 October 2008 03: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 #51094 is a reply to message #51040] |
Tue, 21 October 2008 13:49  |
Eclipse User |
|
|
|
Mike,
The features of opening/creating datamodels and populating the model file
from the database are provided by Rational Data Architect and are not in
DTP. I recommend going through normal IBM support channels for your
questions to get the proper level of attention.
Larry
|
|
|
Re: standalone sync plugin [message #593594 is a reply to message #50980] |
Fri, 17 October 2008 13:20  |
Eclipse User |
|
|
|
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 #593612 is a reply to message #51009] |
Fri, 17 October 2008 15:23  |
Eclipse User |
|
|
|
> 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
|
|
|
Re: standalone sync plugin [message #593630 is a reply to message #51040] |
Tue, 21 October 2008 13:49  |
Eclipse User |
|
|
|
Mike,
The features of opening/creating datamodels and populating the model file
from the database are provided by Rational Data Architect and are not in
DTP. I recommend going through normal IBM support channels for your
questions to get the proper level of attention.
Larry
|
|
|
Powered by
FUDForum. Page generated in 0.04951 seconds