I need some help in ATL transformation when use KDM [message #1007295] |
Tue, 05 February 2013 07:20  |
Eclipse User |
|
|
|
I have two metamodel a SQL Model and a KDM Data package. The former contains three metaclasses DataBase, Table and Column. The latter represents the artifacts related to persistent data, such as indexed files, relational databases, and other kinds of data storage.
In this context, I would like to transform the first metamodel (SQL Model) to the KDM Data package. Thus, I have created the following atl code.
-- @path MM=/SQLMODEL/model/sqlmodel.ecore
-- @nsURI MM1=http://www.eclipse.org/MoDisco/kdm/data
-- @nsURI MM1=http://www.eclipse.org/MoDisco/kdm/code
module teste;
create OUT : MM1 from IN : MM;
rule dataBase2RelationalSchema {
from
t : MM!Database
to
r : MM1!RelationalSchema (
name <- t.name,
dataElement <- t.tables
)
}
rule table2RelationalTable {
from
t : MM!Table
to
r : MM1!RelationalTable (
name <- t.name,
dataElement <- t.columns
)
}
rule column2ColumnSet {
from
t : MM!Column
to
r : MM1!ColumnSet (
name <- t.name,
itemUnit <- item
),
item : MM1!ItemUnit (
type <- type
),
type : MM1!Datatype (
name <- t.type
)
}
However it is not complete. Could someone help on this? Someone has an example ?
thanks in advance.
|
|
|
|
Re: I need some help in ATL transformation when use KDM [message #1007344 is a reply to message #1007314] |
Tue, 05 February 2013 10:20   |
Eclipse User |
|
|
|
Hello Hugo firstly thanks..
I would like to transform my column type, which is just a String, to IntegerType, StringType, BooleanType, etc. In addition my SQL model also has an meta attribute named isPrimaryKey, which describes if that columns is a primary Key. Thus, I would like also to transform the Columns (of the SQL Model) to IntegerType, StringType, etc and sign that such Colums is primaryKey using the UniqueKey...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06404 seconds