diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 645ab12..5803937 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '8' + java-version: '17' cache: 'maven' - name: Test and aggregate surefire report @@ -76,7 +76,7 @@ jobs: - uses: javiertuya/branch-snapshots-action@v1.2.2 with: token: ${{ secrets.GITHUB_TOKEN }} - java-version: '8' + java-version: '17' mvn-deploy-args: '-P publish-github -DskipTests=true -Dmaven.test.failure.ignore=false -U --no-transfer-progress' delete-old-snapshots: true min-snapshots-to-keep: 2 diff --git a/.gitignore b/.gitignore index 5c8e27b..d1df2e0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ pom.xml.versionsBackup TESTS-TestSuites.xml *.db */dat/out - .idea # to allow each developer customize sonarlint org.sonarlint.eclipse.core.prefs +.settings/ \ No newline at end of file diff --git a/.project b/.project index e7f45f7..c4c07bf 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - samples-giis-template + modevo diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/README.md b/README.md index 8ef6f3b..661a5fd 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,80 @@ [![Status](https://github.com/giis-uniovi/modevo/actions/workflows/test.yml/badge.svg)](https://github.com/giis-uniovi/modevo/actions) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=my%3Amodevo&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=my%3Amodevo) +# MoDEvo - Model-driven approach to maintain data integrity for evolution of column family DBMSs -# samples-giis-template +This repository contains the modules of the Model-driven engineering approach MoDEvo, which provides the data migrations required to maintain data integrity in a column family DBSM when the database evolves: -Template project, includes: -- Configuration of a maven multimodule java project -- Aggregated test reports (surefire and junit style) -- SonarQube static test (includes coverage results) -- Publish a snapshot for each branch to GitHub Packages -- Publish releases to Maven Central (deactivated) +- Provide a data migration model given an evolution of the schema. +- Transformation of the data migration model in a script. +- Execution of the script against a Cassandra database. +- Available for Java 17 and higher. -See the general contribution policies and guidelines for *giis-uniovi* at -[CONTRIBUTING.md](https://github.com/giis-uniovi/.github/blob/main/profile/CONTRIBUTING.md). +## Quick Start + +Currently, MoDEvo can be used by importing it as a Maven project in Eclipse. MoDEvo transforms the the input models of MoDEvo (Schema, Schema Evolution and Conceptual Model) requires into a Data Migration model by executing ATL transformations. There are two possible ways to execute these transformations: + +- Using the ATL module: Run from Eclipse the MoDEvo.atl as an ATL transformation. In the configuration menu, you must insert the paths for the inputs models and the path where the output model will be generated. It is required to install the last version of the ATL module in Eclipse (https://download.eclipse.org/mmt/atl/updates/releases/) + +- Using Java: Create a Main Java class or a test case using JUnit that imports the class `MainTransformations` and then call the method `createDataMigrationModelAndScript` with the corresponding input models paths and the output model path. + +
Java + +```Java Main class +import giis.modevo.transformations.MainTransformations; +public static void main (String[] args){ + new MainTransformations().createDataMigrationModelAndScript("pathSchema.xml", "pathConceptuaModel.xml", "pathSchemaEvolution.xml", "outputPath.xml"); + } +``` +```Java Test Case +@Test + public void testExample () { + new MainTransformations().createDataMigrationModelAndScript("pathSchema.xml", "pathConceptuaModel.xml", "pathSchemaEvolution.xml", "outputPath.xml"); + } +``` + + + +
+ + +## Modules + +MoDEvo is composed of the following modules: + +- `modevo-transform`: Transforms the input models (Schema, Schema Evolution and Conceptual Model) in a Data Migration model that specifies the data migrations to perform. +- `modevo-script`: Transforms a Data Migration model in scripts stored as Java objects that can, optionally be executed against a Cassandra database using this module. It also provides a textual representation of the script in a Cassandra Query Language-like language. + +## modevo-transform module + +Determines the data migrations required to maintain the data integrity in a column family DBMS . It determines these migration through the execution of ATL transformations that are located in the package `giis.modevo.transformations.atl`. In order to execute these transformations, MoDEvo requires of the following input models in xml format: + +- Conceptual Model: Contains the structure of the conceptual model, specifying its entities, their relationships and the attributes that are part of an entity or relationship. +- Schema: Contains the structure of the schema, specifying its tables and the columns of these tables. It also contains the association of each column with an attribute of the schema. +- Schema Evolution: Contains the evolution performed in the schema. + +Given these three inputs models, MoDEvo transforms them into a Data Migration model: + +- Data Migration: Contains all the migrations that are required to maintain the data integrity. + +In addition, Java objects of each of the input and output models are created to be used in the MoDEvo-script module. + +## modevo-script module + +Transforms the data migration model generated in the MoDEvo-transformation module into a script that can be executed against a column family DBSM. Currently it supports the most used column family DBSM, Apache Cassandra. In order to execute this transformation, MoDEvo requires the Schema, Schema Evolution and Data Migration models as Java objects. + +Given these objects, MoDEvo creates one script for each table that requires data migrations in two ways: + +- Textual representation in a Cassandra Query Language-like format. It is composed of the three basic opeators FOR, SELECT and INSERT. +- Optionally, the script can be executed in a Cassandra database, requiring to configure the "MoDEvo.properties" file located in the root with the appropiate values. + +## Citing this work + +TODO + +## Related work + +Suárez-Otero, P., Mior, M. J., Suárez-Cabal, M. J., & Tuya, J. (2023). CoDEvo: Column family database evolution using model transformations. Journal of Systems and Software, 111743. + +Suárez-Otero González, P., Mior, M. J., Suárez Cabal, M. J., & Tuya González, P. J. (2023, March). Data migration in column family database evolution using MDE. In Workshop Proceedings of the EDBT/ICDT 2023 Joint Conference (March 28-March 31, 2023, Ioannina, Greece). George Fletcher and Verena Kantere. + +Suárez-Cabal, M. J., Suárez-Otero, P., de la Riva, C., & Tuya, J. (2023). MDICA: Mainte-nance of data integrity in column-oriented database applications. Computer Standards & In-terfaces, 83, 103642. diff --git a/samples-giis-template-bom/.project b/modevo-bom/.project similarity index 89% rename from samples-giis-template-bom/.project rename to modevo-bom/.project index e05dd63..5315ae0 100644 --- a/samples-giis-template-bom/.project +++ b/modevo-bom/.project @@ -1,6 +1,6 @@ - samples-giis-template-bom + modevo-bom diff --git a/samples-giis-template-bom/pom.xml b/modevo-bom/pom.xml similarity index 68% rename from samples-giis-template-bom/pom.xml rename to modevo-bom/pom.xml index 151f550..130369c 100644 --- a/samples-giis-template-bom/pom.xml +++ b/modevo-bom/pom.xml @@ -2,14 +2,14 @@ 4.0.0 io.github.giis-uniovi - samples-giis-template + modevo 1.0.1-SNAPSHOT - samples-giis-template-bom + modevo-bom pom - samples-giis-template-bom - Multimodule maven project template, bill of materials - http://github.com/giis-uniovi/samples-giis-template + modevo-bom + MoDEvo bill of materials + http://github.com/giis-uniovi/modevo Software Engineering Research Group (GIIS) - Universidad de Oviedo, ES http://giis.uniovi.es/ @@ -18,12 +18,12 @@ io.github.giis-uniovi - samples-giis-template-m1 + modevo-transform ${project.version} io.github.giis-uniovi - samples-giis-template-m2 + modevo-script ${project.version} diff --git a/samples-giis-template-m1/.classpath b/modevo-script/.classpath similarity index 98% rename from samples-giis-template-m1/.classpath rename to modevo-script/.classpath index f7e4a1d..7a9a105 100644 --- a/samples-giis-template-m1/.classpath +++ b/modevo-script/.classpath @@ -26,7 +26,7 @@ - + diff --git a/samples-giis-template-m1/.project b/modevo-script/.project similarity index 92% rename from samples-giis-template-m1/.project rename to modevo-script/.project index fffa2e4..8c4cc5b 100644 --- a/samples-giis-template-m1/.project +++ b/modevo-script/.project @@ -1,6 +1,6 @@ - samples-giis-template-m1 + modevo-script diff --git a/samples-giis-template-m2/pom.xml b/modevo-script/pom.xml similarity index 82% rename from samples-giis-template-m2/pom.xml rename to modevo-script/pom.xml index 04b6af2..dcd593e 100644 --- a/samples-giis-template-m2/pom.xml +++ b/modevo-script/pom.xml @@ -2,14 +2,14 @@ 4.0.0 io.github.giis-uniovi - samples-giis-template + modevo 1.0.1-SNAPSHOT - samples-giis-template-m2 + modevo-script jar - samples-giis-template-m2 - Multimodule maven project template, module with dependencies - http://github.com/giis-uniovi/samples-giis-template + modevo-script + MoDEvo script module + http://github.com/giis-uniovi/modevo Software Engineering Research Group (GIIS) - Universidad de Oviedo, ES http://giis.uniovi.es/ @@ -17,7 +17,7 @@ io.github.giis-uniovi - samples-giis-template-m1 + modevo-transform ${project.version} diff --git a/samples-giis-template-m2/src/main/java/giis/m2/Class2.java b/modevo-script/src/main/java/giis/m2/Class2.java similarity index 100% rename from samples-giis-template-m2/src/main/java/giis/m2/Class2.java rename to modevo-script/src/main/java/giis/m2/Class2.java diff --git a/samples-giis-template-m2/src/test/java/giis/m2/TestClass2.java b/modevo-script/src/test/java/giis/m2/TestClass2.java similarity index 100% rename from samples-giis-template-m2/src/test/java/giis/m2/TestClass2.java rename to modevo-script/src/test/java/giis/m2/TestClass2.java diff --git a/samples-giis-template-m1/src/test/resources/log4j2.xml b/modevo-script/src/test/resources/log4j2.xml similarity index 100% rename from samples-giis-template-m1/src/test/resources/log4j2.xml rename to modevo-script/src/test/resources/log4j2.xml diff --git a/samples-giis-template-m2/.classpath b/modevo-transform/.classpath similarity index 98% rename from samples-giis-template-m2/.classpath rename to modevo-transform/.classpath index f7e4a1d..7a9a105 100644 --- a/samples-giis-template-m2/.classpath +++ b/modevo-transform/.classpath @@ -26,7 +26,7 @@ - + diff --git a/samples-giis-template-m2/.project b/modevo-transform/.project similarity index 92% rename from samples-giis-template-m2/.project rename to modevo-transform/.project index cdaffce..294e000 100644 --- a/samples-giis-template-m2/.project +++ b/modevo-transform/.project @@ -1,6 +1,6 @@ - samples-giis-template-m2 + modevo-transform diff --git a/samples-giis-template-m1/pom.xml b/modevo-transform/pom.xml similarity index 83% rename from samples-giis-template-m1/pom.xml rename to modevo-transform/pom.xml index 1cfee5f..5b3957e 100644 --- a/samples-giis-template-m1/pom.xml +++ b/modevo-transform/pom.xml @@ -2,14 +2,14 @@ 4.0.0 io.github.giis-uniovi - samples-giis-template + modevo 1.0.1-SNAPSHOT - samples-giis-template-m1 + modevo-transform jar - samples-giis-template-m1 - Multimodule maven project template, module without dependencies - http://github.com/giis-uniovi/samples-giis-template + modevo-transform + MoDEvo transform module + http://github.com/giis-uniovi/modevo Software Engineering Research Group (GIIS) - Universidad de Oviedo, ES http://giis.uniovi.es/ diff --git a/samples-giis-template-m1/src/main/java/giis/m1/Class1.java b/modevo-transform/src/main/java/giis/m1/Class1.java similarity index 100% rename from samples-giis-template-m1/src/main/java/giis/m1/Class1.java rename to modevo-transform/src/main/java/giis/m1/Class1.java diff --git a/samples-giis-template-m1/src/test/java/giis/m1/TestClass1.java b/modevo-transform/src/test/java/giis/m1/TestClass1.java similarity index 100% rename from samples-giis-template-m1/src/test/java/giis/m1/TestClass1.java rename to modevo-transform/src/test/java/giis/m1/TestClass1.java diff --git a/samples-giis-template-m2/src/test/resources/log4j2.xml b/modevo-transform/src/test/resources/log4j2.xml similarity index 100% rename from samples-giis-template-m2/src/test/resources/log4j2.xml rename to modevo-transform/src/test/resources/log4j2.xml diff --git a/pom.xml b/pom.xml index 65538d5..eec6d47 100644 --- a/pom.xml +++ b/pom.xml @@ -1,30 +1,30 @@ 4.0.0 io.github.giis-uniovi - samples-giis-template + modevo 1.0.1-SNAPSHOT pom - samples-giis-template - Multimodule maven project template - http://github.com/giis-uniovi/samples-giis-template + modevo + Model-driven approach to maintain data integrity for evolution of column family DBMSs + http://github.com/giis-uniovi/modevo Software Engineering Research Group (GIIS) - Universidad de Oviedo, ES http://giis.uniovi.es/ - 1.8 - 1.8 + 17 + 17 UTF-8 3.2.5 - samples-giis-template-m1 - samples-giis-template-m2 - samples-giis-template-bom + modevo-transform + modevo-script + modevo-bom @@ -183,6 +183,18 @@ + + Pablo Suarez-Otero + http://giis.uniovi.es + + + Michael Mior + https://cs.rit.edu/~dataunitylab/ + + + Maria Jose Suarez-Cabal + http://giis.uniovi.es + Javier Tuya http://giis.uniovi.es @@ -191,11 +203,11 @@ Apache-2.0 - https://github.com/giis-uniovi/samples-giis-template/blob/main/LICENSE + https://github.com/giis-uniovi/modevo/blob/main/LICENSE - https://github.com/giis-uniovi/samples-giis-template + https://github.com/giis-uniovi/modevo/blob/main/LICENSE @@ -206,7 +218,7 @@ github GitHub Apache Maven Packages - https://maven.pkg.github.com/giis-uniovi/samples-giis-template + https://maven.pkg.github.com/giis-uniovi/modevo diff --git a/samples-giis-template-bom/.settings/org.eclipse.core.resources.prefs b/samples-giis-template-bom/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/samples-giis-template-bom/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/samples-giis-template-bom/.settings/org.eclipse.m2e.core.prefs b/samples-giis-template-bom/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/samples-giis-template-bom/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/samples-giis-template-m1/.settings/org.eclipse.core.resources.prefs b/samples-giis-template-m1/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 29abf99..0000000 --- a/samples-giis-template-m1/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,6 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 -encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 -encoding/=UTF-8 diff --git a/samples-giis-template-m1/.settings/org.eclipse.jdt.core.prefs b/samples-giis-template-m1/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2f5cc74..0000000 --- a/samples-giis-template-m1/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/samples-giis-template-m1/.settings/org.eclipse.m2e.core.prefs b/samples-giis-template-m1/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/samples-giis-template-m1/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/samples-giis-template-m2/.settings/org.eclipse.core.resources.prefs b/samples-giis-template-m2/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 29abf99..0000000 --- a/samples-giis-template-m2/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,6 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 -encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 -encoding/=UTF-8 diff --git a/samples-giis-template-m2/.settings/org.eclipse.jdt.core.prefs b/samples-giis-template-m2/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2f5cc74..0000000 --- a/samples-giis-template-m2/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/samples-giis-template-m2/.settings/org.eclipse.m2e.core.prefs b/samples-giis-template-m2/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/samples-giis-template-m2/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/sonar-project.properties b/sonar-project.properties index 8a046d9..99a4a32 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,8 +2,8 @@ sonar.projectKey=my:modevo sonar.projectName=modevo sonar.organization=giis sonar.projectVersion=1.0 -sonar.java.source=1.8 -sonar.modules=samples-giis-template-m1,samples-giis-template-m2 +sonar.java.source=17 +sonar.modules=modevo-transform,modevo-script sonar.sources=src/main/java sonar.sourceEncoding=UTF-8 sonar.tests=src/test/java @@ -11,4 +11,4 @@ sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes sonar.language=java sonar.junit.reportsPath=**/target/surefire-reports -sonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco/jacoco.xml +sonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco/jacoco.xml \ No newline at end of file