Skip to main content



      Home
Home » Modeling » Papyrus » From UML to SQL
From UML to SQL [message #1829428] Fri, 03 July 2020 03:50 Go to next message
Eclipse UserFriend
Hello,

I could be interested by a way to generate SQL code from an UML model. I am aware of the Information Modeling project but I'm not sure it adress this topic, As far as I know, we can't generate SQL code to create a relationnal DB from a model. I believe we can do that with EA for example. Is there such feature in Eclipse/UML/Papyrus world?
If not, what could be the most appropriate entry point to do that? Information Modeling project? Existing profile?

Regards.

Yoann.
Re: From UML to SQL [message #1829432 is a reply to message #1829428] Fri, 03 July 2020 05:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi Yoann,

to generate which SQL code?
There is CRUD (create, read, update, delete) for both the tables themselves and the data to be managed.

And why?
The persistence frameworks around abstract completely from the kind of database without any runtime performance impact. And if you decide to use a rDBMS the persistence framework does the SQL magic.

/Carsten
Re: From UML to SQL [message #1829433 is a reply to message #1829432] Fri, 03 July 2020 05:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Carsten,

For the moment, I would generate SQL code to init the DB (at least tables creation). If possible manage all operations (CRUD) on the tables would be good.

And to answer to the why : I'm developping a feature to make easier the interaction between a code generated from Papyrus (in C++) with a relationnal DB. I would like to make that the user can create the database structure in UML and use a SQL generator to build the corresponding DB.

Hopefully the need is clearer.

Yoann.
Re: From UML to SQL [message #1829440 is a reply to message #1829433] Fri, 03 July 2020 10:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi Yoann,

I am not aware of any such generator for Eclipse Papyrus.

I wrote such a generator for a customer as AndroMDA cartridge some 15 years ago. That generator utilized some naming conventions to mark table columns should be unique or indexed. Query-, update- and delete-operations were only generated for indexed columns. These conventions made the generator damn easy to implement and the resulting code quite well performing.

But this approach requires a pure data model being used by other code.

/Carsten


Re: From UML to SQL [message #1830334 is a reply to message #1829440] Thu, 23 July 2020 09:40 Go to previous messageGo to next message
Eclipse UserFriend
Hello Yoann,
Papyrus doesn't provide such a generator to create SQL table. I think you should modelize your table with a Class Diagram, then write the generator to create the table.

Regards,
/Vincent
Re: From UML to SQL [message #1836608 is a reply to message #1830334] Fri, 08 January 2021 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Https://www.samsara-software.es
Can find a plugin for Oracle, mysql and Postgres.
Code generation for JPA and queries included for JPQL.
If interested, contact perelengo@hotmail.com the project is in standby but can provide some help.
Re: From UML to SQL [message #1836609 is a reply to message #1836608] Fri, 08 January 2021 16:53 Go to previous message
Eclipse UserFriend
Check this channel if wanna have a look to a demo
https://youtube.com/channel/UC7a_91A5Ikp21POVurHKX8Q
Previous Topic:Create a diagram programmatically
Next Topic:Diagram and model synchronisation
Goto Forum:
  


Current Time: Sun Jul 13 18:08:38 EDT 2025

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

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

Back to the top