|
Re: How to parse an XMI file to SQL [message #1033460 is a reply to message #1033398] |
Thu, 04 April 2013 08:42 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Sams,
Maybe the Teneo project can be of help, it supports mapping of emf/ecore models to relational models:
http://wiki.eclipse.org/Teneo/Hibernate
Or if you want to go the standard JPA approach then check out the Texo project:
http://wiki.eclipse.org/Texo
gr. Martin
On 04/04/2013 09:44 AM, sams good wrote:
> hello, I've used ATL to generate an XMI file corresponding to an UML Class diagram by following this tutorial
> http://www.eclipse.org/atl/atlTransformations/Class2Relational/ExampleClass2Relational[v00.01
> the XMI is generated successfully and look like this: <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="Relational">
> <Table name="Family" key="/0/@col.0">
> <col name="objectId" keyOf="/0" type="/3"/>
> <col name="name" type="/2"/>
> </Table>
> <Table name="Person" key="/1/@col.0">
> <col name="objectId" keyOf="/1" type="/3"/>
> <col name="firstName" type="/2"/>
> <col name="closestFriendId" type="/3"/>
> </Table>
> <Type name="String"/>
> <Type name="Integer"/>
> <Table name="Person_emailAddresses">
> <col name="PersonId" type="/3"/>
> <col name="emailAddresses" type="/2"/>
> </Table>
> <Table name="Family_members">
> <col name="FamilyId" type="/3"/>
> <col name="membersId" type="/3"/>
> </Table>
> </xmi:XMI>
>
> I've tried this https://code.google.com/p/xmi-to-sql/ but it couldn't validate the my XMI file. so, is EMF provide a
> solution to parse this XMI output file directly to an SQL code ? if not, what do you suggest to me? thank you.
--
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: How to parse an XMI file to SQL [message #1033547 is a reply to message #1033485] |
Thu, 04 April 2013 10:55 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Sams,
Another option is liquibase (liquibase.org), maybe you can create a xml file which can be read by liquibase. Liquibase
can then generate the ddl/sql for you.
gr. Martin
On 04/04/2013 11:20 AM, sams good wrote:
> Thank you Martin for the answer,
> for Teneo , I've already tried it and successfully worked. but In my project I need somthing more transparent than Teneo
> and I only need the .sql script file corresponding to the XMI (Teneo generates a lot of files and packages). I've
> thinked for XSLT, but I'd like to know if there is another elegant way to do it?
--
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02411 seconds