Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » Generate code SQL in Eclipse
icon12.gif  Generate code SQL in Eclipse [message #552635] Thu, 12 August 2010 23:28
Carmen  is currently offline Carmen Friend
Messages: 5
Registered: August 2010
Junior Member
Find this code and would like to try it but I need to run it I have only the metamodel is a class diagram which incidentally has a table called DB Model, if someone can explain? or give me an email to talk, I need this info is very important to me now. To pass such a model class to generate SQL code I need the SQL metamodel? you use, because I read somewhere that relies on technology to pass. I appreciate your answers.

texttransformation relationalModel2sql (in relational: "http:///relational.ecore") (

fileExtension property = '. sql'

relational.DBModel:: main () (
stdout.println ('starting transformation')
self.mapDBModel ()

relational.DBModel:: mapDBModel () (
file (self.name + fileExtension)
'\ NCREATE DATABASE' self.name '; "
self.tables -> forEach (table: relational.Table) (
table.mapTable ()

relational.Table:: mapTable () (
'\ N \ nCREATE TABLE' self.name '('
self.columns -> forEach (col: relational.Column) (
col.mapColumn ()
if (! self.columns.last () == col) (

relational.Column:: mapColumn () (
'\ N \ t' self.name '' self.type.mapType ()
if (self.keyOf! = null) (
'PIMARY KEY NOT NULL'
Previous Topic:error while checking out AM3
Next Topic:Unexpected output
Goto Forum:
  


Current Time: Thu Apr 25 02:26:38 GMT 2024

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

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

Back to the top