Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using EMF with existing database(EMF database)
Using EMF with existing database [message #1712539] Mon, 26 October 2015 10:16 Go to next message
erwan drezen is currently offline erwan drezenFriend
Messages: 8
Registered: October 2015
Junior Member
Hello,

I am working on a project with a huge third party MySQL database (hundred of GBytes) and I have to develop specific GUI applications to query this database.

In particular, I have no logical view on this database and I can only deal with the low level MySQL shema. I wrote a high level model in ECore from this schema (kind of reverse enginering) and transformed a part of the original MySQL database into my model by using CDO. I tested OCL to query my model and it works pretty well.

However, I am facing a very long execution time when I try to transform the whole initial MySQL db into my own model, which makes this transformation not usable on real data.

So, my question is : is it possible to "link" my EMF model with the already existing database ? By linking, I mean writing some kind of specific java adapter that knows how to convert the concepts of my ECore model into the schema of the MySQL database.

Important point : my final GUI application only reads the database and doesn't need to modify it.
Re: Using EMF with existing database [message #1712811 is a reply to message #1712539] Wed, 28 October 2015 12:10 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 26.10.2015 um 14:21 schrieb erwan drezen:
> Hello,
>
> I am working on a project with a huge third party MySQL database (hundred of GBytes) and I have to develop specific
> GUI applications to query this database.
> In particular, I have no logical view on this database and I can only deal with the low level MySQL shema. I wrote a
> high level model in ECore from this schema (kind of reverse enginering) and transformed a part of the original MySQL
> database into my model by using CDO. I tested OCL to query my model and it works pretty well.
>
> However, I am facing a very long execution time when I try to transform the whole initial MySQL db into my own model,
I don't get what you intend to say with this sentence. What means "transform" and "initial"? What is executed and how
long is long? How big is the DB or the model?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> which makes this transformation not usable on real data.
>
> So, my question is : is it possible to "link" my EMF model with the already existing database ? By linking, I mean
> writing some kind of specific java adapter that knows how to convert the concepts of my ECore model into the schema of
> the MySQL database.
> Important point : my final GUI application only reads the database and doesn't need to modify it.
>


Re: Using EMF with existing database [message #1712899 is a reply to message #1712811] Thu, 29 October 2015 09:03 Go to previous message
erwan drezen is currently offline erwan drezenFriend
Messages: 8
Registered: October 2015
Junior Member
Hello Eike,

Thank you for your reply.

My initial data is stored in a MySQL database A with a third party schema. What I did is some reverse engineering by creating an ecore metamodel B from the schema of database A. Then, I wrote some code that creates a model of B by reading the information from database A; that is what I mean by transform.

My idea was to have a high level view of the data through an ecore model and to delegate the storage part to CDO, which looks attractive. However, the MySQL database is hundred of GBytes big, and so would be the ecore instance of metamodel B. I made some tests on a fraction of the MySQL database and it already takes quite a long time to transform from A to B representation.

I am currently shifting to a more direct approach: I am writing a custom implementation of the API generated by the EMF genmodel for my metamodel B. This custom implementation directly reads the MySQL database A and adapts the read information to my metamodel concepts. This is eventually the best option I found so far in my context (ie. adapting an existing MySQL database to a hand-written ecore metamodel)

Previous Topic:[CDO] Timeout in ChangeCredentialsRequest
Next Topic:EMF: "preset" value (not default value) from another EObject property
Goto Forum:
  


Current Time: Fri Mar 29 06:42:13 GMT 2024

Powered by FUDForum. Page generated in 0.07872 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top