Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Generate ecore model from database?
[Teneo] Generate ecore model from database? [message #1106627] Wed, 11 September 2013 10:45 Go to next message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
Hello everyone,

I have used Hibernate before and I know that it is possible to generate from the database structure hibernate classes.
Is something similar possible with Teneo or is there a recommended way to create an ecore model for an existing database?

Thanks in advance.
Re: [Teneo] Generate ecore model from database? [message #1106688 is a reply to message #1106627] Wed, 11 September 2013 12:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi John,
This topic has come up a few times the past few years. I even tried to start with a contributor on this, but this
initiative didn't continue. It is a fair amount of work I guess (to do it smartly for example detect join tables).

It makes really sense to have this logic but it is some work to do and therefore would need to be contributed (I can
help out in that case) or funded/sponsored.

gr. Martin

On 09/11/2013 12:45 PM, John M. wrote:
> Hello everyone,
>
> I have used Hibernate before and I know that it is possible to generate from the database structure hibernate classes.
> Is something similar possible with Teneo or is there a recommended way to create an ecore model for an existing database?
>
> Thanks in advance.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Generate ecore model from database? [message #1111696 is a reply to message #1106688] Wed, 18 September 2013 15:42 Go to previous messageGo to next message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
Hello Martin,

sounds really interesting. Are there any stubs from the first "try"?
I think a good start would be the generation of the eclass out of a database. If this works fine add the relations and so on. Smile
Re: [Teneo] Generate ecore model from database? [message #1111860 is a reply to message #1111696] Wed, 18 September 2013 20:57 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hmm, I did a search, a bit awkard but I can't find any artifacts from this first effort... it is from many years back.

I totally agree that a first step would generate the eclass. So using the database metadata generate eclasses and some
ereferences (based on foreign keys). A next step/future thing is to generate JPA annotations in the generated ecore to
support mapping of the ecore to the original database model.
Other future topic is to support some name mapping from database technical names to readable names. Sometimes in the
dbschema there are very technical names or name length limitations, while in the model you want readable names.

Let me know if you need some help or if you want me to review code, or would want to cooperate in a different way, you
can always drop me a direct email to discuss more. Whatever works best for you!

gr. Martin

On 09/18/2013 05:42 PM, John M. wrote:
> Hello Martin,
>
> sounds really interesting. Are there any stubs from the first "try"?
> I think a good start would be the generation of the eclass out of a database. If this works fine add the relations and
> so on. :)


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Generate ecore model from database? [message #1122595 is a reply to message #1106627] Tue, 01 October 2013 18:55 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
MoDisco already has some support for reverse engineering SQL databases. I haven't played around with it that much, but perhaps it could be helpful for your use case.

cheers,

Miles
Re: [Teneo] Generate ecore model from database? [message #1130014 is a reply to message #1122595] Wed, 09 October 2013 06:37 Go to previous messageGo to next message
Gordan Vosicki is currently offline Gordan VosickiFriend
Messages: 13
Registered: March 2013
Junior Member
I have actually written a DB "sniffer" some time ago, it was for the first release of JDO (2001 ?).
It generated a model of the database, a default corresponding object model, a mapping and the JDO object classes, already enhanced in source code.

What would be required to do is design a new ecore model of a RDB schema (maybe it already exists ?) and define standard ecore annotations for the mapping.
Would it be useful for you as a start point, or just as a source of inspiration ?
Re: [Teneo] Generate ecore model from database? [message #1130555 is a reply to message #1130014] Wed, 09 October 2013 17:49 Go to previous message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
@Miles:
Thanks for the hint with MoDisco, but I don't find a "real" solution how to import from a database.

@Gordan:
I think it would be a good start point, but I am new to this business. Smile
Previous Topic:[ EEF ] View composition
Next Topic:[Teneo] (rewritten question): Resource is empty on read, despite DB populated correctly
Goto Forum:
  


Current Time: Thu Mar 28 09:34:54 GMT 2024

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

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

Back to the top