diff --git a/README.md b/README.md index a49cedd..55f7a32 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # org.eclipse.daanse.rdb -Repository for the relational database related modules +not longer used see rolap.mapping or cwm diff --git a/dbcreator/pom.xml b/dbcreator/pom.xml deleted file mode 100644 index 0f07e6f..0000000 --- a/dbcreator/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.dbcreator - - - - org.slf4j - slf4j-api - - - org.eclipse.daanse - org.eclipse.daanse.jdbc.db.api - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.jdbc.db.record - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - diff --git a/dbcreator/src/main/java/org/eclipse/daanse/rdb/dbcreator/DatabaseCreator.java b/dbcreator/src/main/java/org/eclipse/daanse/rdb/dbcreator/DatabaseCreator.java deleted file mode 100644 index ced6a57..0000000 --- a/dbcreator/src/main/java/org/eclipse/daanse/rdb/dbcreator/DatabaseCreator.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.dbcreator; - -import java.util.List; - -import org.eclipse.daanse.jdbc.db.api.sql.SqlStatement; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; - -public interface DatabaseCreator { - - List createSqlStatements(DatabaseCatalog catalog); - -} diff --git a/dbcreator/src/main/java/org/eclipse/daanse/rdb/dbcreator/DatabaseCreatorImpl.java b/dbcreator/src/main/java/org/eclipse/daanse/rdb/dbcreator/DatabaseCreatorImpl.java deleted file mode 100644 index 1b99858..0000000 --- a/dbcreator/src/main/java/org/eclipse/daanse/rdb/dbcreator/DatabaseCreatorImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.dbcreator; - -import java.sql.JDBCType; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; -import java.util.OptionalInt; - -import org.eclipse.daanse.jdbc.db.api.schema.ColumnDefinition; -import org.eclipse.daanse.jdbc.db.api.schema.ColumnReference; -import org.eclipse.daanse.jdbc.db.api.schema.DropImportedKey; -import org.eclipse.daanse.jdbc.db.api.schema.ImportedKey; -import org.eclipse.daanse.jdbc.db.api.schema.SchemaReference; -import org.eclipse.daanse.jdbc.db.api.schema.TableReference; -import org.eclipse.daanse.jdbc.db.api.sql.SqlStatement; -import org.eclipse.daanse.jdbc.db.record.schema.ColumnDefinitionR; -import org.eclipse.daanse.jdbc.db.record.schema.ColumnMetaDataR; -import org.eclipse.daanse.jdbc.db.record.schema.ColumnReferenceR; -import org.eclipse.daanse.jdbc.db.record.schema.DropImportedKeyR; -import org.eclipse.daanse.jdbc.db.record.schema.ImportedKeyR; -import org.eclipse.daanse.jdbc.db.record.schema.SchemaReferenceR; -import org.eclipse.daanse.jdbc.db.record.schema.TableDefinitionR; -import org.eclipse.daanse.jdbc.db.record.schema.TableReferenceR; -import org.eclipse.daanse.jdbc.db.record.sql.CreateConstraintStatementR; -import org.eclipse.daanse.jdbc.db.record.sql.CreateContainerSqlStatementR; -import org.eclipse.daanse.jdbc.db.record.sql.CreateSchemaSqlStatementR; -import org.eclipse.daanse.jdbc.db.record.sql.DropConstraintStatementR; -import org.eclipse.daanse.jdbc.db.record.sql.DropContainerSqlStatementR; -import org.eclipse.daanse.jdbc.db.record.sql.DropSchemaSqlStatementR; -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.Link; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.ServiceScope; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Component(service = DatabaseCreatorImpl.class, scope = ServiceScope.SINGLETON) -public class DatabaseCreatorImpl implements DatabaseCreator { - - private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseCreatorImpl.class); - - @Override - public List createSqlStatements(DatabaseCatalog catalog) { - List result = new LinkedList<>(); - if (catalog.getSchemas() != null) { - result.addAll(catalog.getSchemas().stream().flatMap(s -> dropCreateSchema(s).stream()).toList()); - LOGGER.debug("create drop/create schema statements"); - result.addAll(catalog.getSchemas().stream().flatMap(s -> dropCreateTables(s).stream()).toList()); - LOGGER.debug("create drop/create tables statements"); - } - if (catalog.getLinks() != null) { - result.addAll(catalog.getLinks().stream().map(l -> dropLinks(l)).toList()); - LOGGER.debug("create drop links statements"); - result.addAll(catalog.getLinks().stream().map(l -> createLinks(l)).toList()); - LOGGER.debug("create create links statements"); - } - return result; - } - - private SqlStatement createLinks(Link l) { - String name = generateLinkName(l); - ColumnReference primaryKey = new ColumnReferenceR(Optional.of(new TableReferenceR(Optional.empty(), - l.getPrimaryKey().getTable().getName())), l.getPrimaryKey().getName()); - ColumnReference foreignKey = new ColumnReferenceR(Optional.of(new TableReferenceR(Optional.empty(), - l.getForeignKey().getTable().getName())), l.getForeignKey().getName()); - ImportedKey importedKey = new ImportedKeyR(primaryKey, foreignKey, name); - return new CreateConstraintStatementR(importedKey); - } - - private SqlStatement dropLinks(Link l) { - String name = generateLinkName(l); - Table foreignKeyTable = l.getForeignKey().getTable(); - DatabaseSchema databaseSchema = foreignKeyTable.getSchema(); - SchemaReference schemaReference = new SchemaReferenceR(databaseSchema.getName()); - TableReference table = new TableReferenceR(Optional.of(schemaReference), foreignKeyTable.getName()); - DropImportedKey dropImportedKey = new DropImportedKeyR(table, name); - return new DropConstraintStatementR(dropImportedKey, true); - } - - private String generateLinkName(Link l) { - //fk_table1_id1_table2_id2 - StringBuilder sb = new StringBuilder("fk_") - .append(l.getForeignKey().getTable().getName()) - .append("_") - .append(l.getForeignKey().getName()) - .append("_") - .append(l.getPrimaryKey().getTable().getName()) - .append("_") - .append(l.getPrimaryKey().getName()); - return sb.toString(); - } - - private Collection dropCreateTables(DatabaseSchema s) { - List result = new LinkedList<>(); - if (s.getTables() != null) { - Optional schema = Optional.of(new SchemaReferenceR(s.getName())); - result.addAll(s.getTables().stream().flatMap(t -> dropCreateTable(schema, t).stream()).toList()); - } - return result; - } - - private Collection dropCreateTable(Optional schema, Table t) { - List result = new LinkedList<>(); - TableReference container = new TableReferenceR(schema, t.getName()); - TableDefinitionR tableDefinition = new TableDefinitionR(container); - List columnDefinitions = getColumnDefinitions(schema, t); - result.add(new DropContainerSqlStatementR(container, true)); - result.add(new CreateContainerSqlStatementR(tableDefinition, columnDefinitions, true)); - return result; - } - - private List getColumnDefinitions(Optional schema, Table t) { - List result = new ArrayList<>(); - if (t.getColumns() != null) { - Optional table = Optional.of(new TableReferenceR(schema, t.getName())); - result.addAll(t.getColumns().stream().map(c -> getColumnDefinition(table, c)).toList()); - } - return result; - } - - private ColumnDefinition getColumnDefinition(Optional table, Column c) { - - ColumnReference column = new ColumnReferenceR(table, c.getName()); - JDBCType dataType = JDBCType.valueOf(c.getType().toUpperCase()); -// Optional columnSize = column; -// Optional decimalDigits = Optional.empty(); -// if (c.getTypeQualifiers() != null) { -// if (c.getTypeQualifiers().size() > 0) { -// columnSize = Optional.ofNullable(Integer.parseInt(c.getTypeQualifiers().get(0))); -// } -// if (c.getTypeQualifiers().size() > 1) { -// decimalDigits = Optional.ofNullable(Integer.parseInt(c.getTypeQualifiers().get(1))); -// } -// } - //TODO FIX - ColumnMetaDataR columnType = new ColumnMetaDataR(dataType, "foobar", OptionalInt.empty(), OptionalInt.empty(), - OptionalInt.empty(), OptionalInt.empty(), OptionalInt.empty(), Optional.empty()); - return new ColumnDefinitionR(column, columnType); - } - - private List dropCreateSchema(DatabaseSchema s) { - List result = new LinkedList<>(); - SchemaReference schema = new SchemaReferenceR(s.getName()); - result.add(new DropSchemaSqlStatementR(schema, true)); - result.add(new CreateSchemaSqlStatementR(schema, true)); - return result; - } - - -} diff --git a/dbcreator/src/test/resources/logback-test.xml b/dbcreator/src/test/resources/logback-test.xml deleted file mode 100644 index 2299056..0000000 --- a/dbcreator/src/test/resources/logback-test.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - true - - - - - %-5level %logger{36} - %msg%n - - - - - - - diff --git a/pom.xml b/pom.xml index ef8c354..f18cad0 100644 --- a/pom.xml +++ b/pom.xml @@ -23,16 +23,12 @@ org.eclipse.daanse.rdb ${revision} pom + Eclipse Daanse Relational Database Modeling + Comprehensive relational database structure modeling framework providing EMF-based representation, schema introspection, verification services, and programmatic database creation. Enables systematic database schema analysis, modification, and documentation generation with support for structure validation and automated database provisioning. 0.0.1-SNAPSHOT org.eclipse.daanse.rdb - - 6.1.3 - 6.1.3 - 2.30.0 - 2.36.0 - 2.37.0 2.0.9 @@ -47,18 +43,5 @@ - - structure.api - structure.pojo - structure.emf - structure.modifier.base - structure.modifier.pojo - structure.modifier.emf - dbcreator - structure.reader - structure.check - structure.documentation - - diff --git a/structure.api/pom.xml b/structure.api/pom.xml deleted file mode 100644 index 6c79e8a..0000000 --- a/structure.api/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.api - diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/DatabaseStructureProvider.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/DatabaseStructureProvider.java deleted file mode 100644 index e16f93e..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/DatabaseStructureProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.api; - -import java.util.function.Supplier; - -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; - -public interface DatabaseStructureProvider extends Supplier { - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Column.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Column.java deleted file mode 100644 index 913a439..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Column.java +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -public interface Column { - - String getName(); - - Table getTable(); - - String getType(); - - Integer getColumnSize(); - - Integer getDecimalDigits(); - - Integer getNumPrecRadix(); - - Integer getCharOctetLength(); - - Boolean getNullable(); - - String getDescription(); - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/DatabaseCatalog.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/DatabaseCatalog.java deleted file mode 100644 index 1f910e9..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/DatabaseCatalog.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface DatabaseCatalog { - - List getSchemas(); - - List getLinks(); - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/DatabaseSchema.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/DatabaseSchema.java deleted file mode 100644 index 7e2abac..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/DatabaseSchema.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface DatabaseSchema { - - List getTables(); - - String getName(); - - String getId(); -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/InlineTable.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/InlineTable.java deleted file mode 100644 index 4ce17ef..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/InlineTable.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface InlineTable extends Table { - - List getRows(); -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Link.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Link.java deleted file mode 100644 index 15bdf68..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Link.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -public interface Link { - - Column getPrimaryKey(); - - Column getForeignKey(); -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/PhysicalTable.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/PhysicalTable.java deleted file mode 100644 index d9e5262..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/PhysicalTable.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -public interface PhysicalTable extends Table{ - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Row.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Row.java deleted file mode 100644 index c5eeb75..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Row.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface Row { - - List getRowValues(); - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/RowValue.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/RowValue.java deleted file mode 100644 index f5e7a6e..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/RowValue.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -public interface RowValue { - - Column getColumn(); - - String getValue(); -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SqlStatement.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SqlStatement.java deleted file mode 100644 index e94eab0..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SqlStatement.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface SqlStatement { - - List getDialects(); - - String getSql(); - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SqlView.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SqlView.java deleted file mode 100644 index 5ec0658..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SqlView.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface SqlView extends Table { - - List getSqlStatements(); - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SystemTable.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SystemTable.java deleted file mode 100644 index 3ec307e..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/SystemTable.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -public interface SystemTable extends Table{ - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Table.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Table.java deleted file mode 100644 index 6565b54..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/Table.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -import java.util.List; - -public interface Table { - - String getName(); - - List getColumns(); - - DatabaseSchema getSchema(); - - String getDescription(); - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/ViewTable.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/ViewTable.java deleted file mode 100644 index 9c32a3b..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/ViewTable.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.api.model; - -public interface ViewTable extends Table { - -} diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/package-info.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/package-info.java deleted file mode 100644 index a0bd08f..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/model/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.rdb.structure.api.model; diff --git a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/package-info.java b/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/package-info.java deleted file mode 100644 index 5523da0..0000000 --- a/structure.api/src/main/java/org/eclipse/daanse/rdb/structure/api/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.rdb.structure.api; diff --git a/structure.check/pom.xml b/structure.check/pom.xml deleted file mode 100644 index 0d5f6bd..0000000 --- a/structure.check/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.check - - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.dbcreator - ${project.version} - - - org.osgi - org.osgi.service.metatype.annotations - provided - - - org.osgi - org.osgi.util.converter - compile - - - diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/Cause.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/Cause.java deleted file mode 100644 index 236d9c4..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/Cause.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.rdb.structure.check; - -public enum Cause { - SCHEMA, DATABASE; -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/CheckService.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/CheckService.java deleted file mode 100644 index 9408a33..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/CheckService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.check; - -import java.util.List; - -import javax.sql.DataSource; - -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; - -public interface CheckService { - - List verify(DatabaseCatalog catalog, DataSource dataSource); -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/CheckServiceImpl.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/CheckServiceImpl.java deleted file mode 100644 index ed2f250..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/CheckServiceImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.check; - -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.sql.DataSource; - -import org.eclipse.daanse.jdbc.db.api.DatabaseService; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Deactivate; -import org.osgi.service.component.annotations.Reference; -import org.osgi.service.metatype.annotations.Designate; -import org.osgi.util.converter.Converter; -import org.osgi.util.converter.Converters; - -@Designate(ocd = DatabaseCheckConfig.class) -@Component(service = CheckService.class) -public class CheckServiceImpl implements CheckService { - - public static final Converter CONVERTER = Converters.standardConverter(); - - @Reference() - private DatabaseService databaseService; - - //@Reference - //private DialectResolver dialectResolver; - - private DatabaseCheckConfig config; - - @Activate - public void activate(Map configMap) { - this.config = CONVERTER.convert(configMap) - .to(DatabaseCheckConfig.class); - } - - @Deactivate - public void deactivate() { - config = null; - } - - @Override - public List verify(DatabaseCatalog catalog, DataSource dataSource) { - List results = new ArrayList<>(); - - try (Connection connection = dataSource.getConnection()) { - DatabaseMetaData databaseMetaData = connection.getMetaData(); - //Optional optionalDialect = dialectResolver.resolve(dataSource); - JDBCSchemaWalker walker = new JDBCSchemaWalker(config, databaseService, databaseMetaData, "generic"); - return walker.checkCatalog(catalog); - - } catch (SQLException e) { - results.add(new VerificationResultR("Database access error", e.getMessage(), Level.ERROR, Cause.DATABASE)); - } - - return results; - } - -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/DatabaseCheckConfig.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/DatabaseCheckConfig.java deleted file mode 100644 index 82250e4..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/DatabaseCheckConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.check; - -import org.osgi.service.metatype.annotations.AttributeDefinition; -import org.osgi.service.metatype.annotations.ObjectClassDefinition; - -@ObjectClassDefinition -public interface DatabaseCheckConfig { - - @AttributeDefinition(description = "schemaRequired") - default Boolean isSchemaRequired() { - return true; - } -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/JDBCSchemaWalker.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/JDBCSchemaWalker.java deleted file mode 100644 index d59f890..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/JDBCSchemaWalker.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.rdb.structure.check; - -import org.eclipse.daanse.jdbc.db.api.DatabaseService; -import org.eclipse.daanse.jdbc.db.api.schema.ColumnDefinition; -import org.eclipse.daanse.jdbc.db.api.schema.ColumnReference; -import org.eclipse.daanse.jdbc.db.api.schema.SchemaReference; -import org.eclipse.daanse.jdbc.db.api.schema.TableReference; -import org.eclipse.daanse.jdbc.db.record.schema.ColumnReferenceR; -import org.eclipse.daanse.jdbc.db.record.schema.SchemaReferenceR; -import org.eclipse.daanse.jdbc.db.record.schema.TableReferenceR; -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.InlineTable; -import org.eclipse.daanse.rdb.structure.api.model.PhysicalTable; -import org.eclipse.daanse.rdb.structure.api.model.Row; -import org.eclipse.daanse.rdb.structure.api.model.RowValue; -import org.eclipse.daanse.rdb.structure.api.model.SqlStatement; -import org.eclipse.daanse.rdb.structure.api.model.SqlView; -import org.eclipse.daanse.rdb.structure.api.model.SystemTable; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.eclipse.daanse.rdb.structure.api.model.ViewTable; - -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import static org.eclipse.daanse.rdb.structure.check.Cause.DATABASE; -import static org.eclipse.daanse.rdb.structure.check.Level.ERROR; -import static org.eclipse.daanse.rdb.structure.check.Level.WARNING; - -public class JDBCSchemaWalker { - - public static final String TABLE = "Table"; - public static final String SQL = "Sql"; - public static final String SCHEMA = "Schema"; - public static final String TABLE_S_DOES_NOT_EXIST_IN_DATABASE = "Table %s does not exist in database"; - public static final String COULD_NOT_CHECK_EXISTANCE_OF_SCHEMA_S = "could not check existence of Schema %s"; - public static final String COULD_NOCH_CHECK_EXISTANCE_OF_TABLE_S = "could noch check existence of Table %s"; - public static final String SCHEMA_S_DOES_NOT_EXIST = "Schema %s does not exist"; - public static final String INLINE_TABLE_S_COLUMNS_NOT_DEFINED = "Inline table %s columns not defined"; - public static final String INLINE_TABLE_S_ROWS_NOT_DEFINED = "Inline table %s rows not defined"; - public static final String INLINE_TABLE_ROW_VALUES_NOT_DEFINED = "Inline table row values not defined"; - public static final String INLINE_TABLE_ROW_VALUES_SIZE_NOT_CORRECT = "Inline table %s row values not defined"; - public static final String TABLE_S_COLUMN_NAME_NOT_DEFINED = "Table %s column name not defined"; - public static final String TABLE_S_COLUMN_TYPE_NOT_DEFINED = "Table %s column type not defined"; - public static final String COLUMN_S_DOES_NOT_EXIST_IN_TABLE_S = "Column %s does not exist in table %s"; - public static final String SQL_VIEW_TABLE_S_STATEMENTS_NOT_DEFINED = "Sql view table %s statements not defined"; - public static final String COULD_NOT_LOOKUP_EXISTANCE_OF_COLUMN_S_DEFINED_IN_TABLE_S = "Could not lookup " + - "existance of columns %s defined in tabe %s"; - - private DatabaseService databaseService; - private DatabaseCheckConfig config; - private DatabaseMetaData databaseMetaData; - private String dialect; - protected List results = new ArrayList<>(); - - public JDBCSchemaWalker( - DatabaseCheckConfig config, - DatabaseService databaseService, - DatabaseMetaData databaseMetaData, - String dialect - ) { - this.config = config; - this.databaseService = databaseService; - this.databaseMetaData = databaseMetaData; - this.dialect = dialect; - } - - protected void checkSqlStatements(List list) { - if (list != null && dialect != null) { - List sqls = - list.stream().filter(sql -> sql.getDialects().stream().anyMatch(d -> dialect.equals(d))).toList(); - if (!sqls.isEmpty()) { - checkSqlStatement(sqls.get(0)); - } else { - sqls = - list.stream().filter(sql -> sql.getDialects().stream().anyMatch(d -> "generic".equals(d))).toList(); - if (!sqls.isEmpty()) { - checkSqlStatement(sqls.get(0)); - } - } - } else { - List sqls = - list.stream().filter(sql -> sql.getDialects().stream().anyMatch(d -> "generic".equals(d))).toList(); - if (!sqls.isEmpty()) { - checkSqlStatement(sqls.get(0)); - } - } - } - - protected void checkSqlStatement(SqlStatement sql) { - if (sql != null && sql.getSql() != null) { - try { - Connection con = databaseMetaData.getConnection(); - Statement stmt = con.createStatement(); - ResultSet rs = stmt.executeQuery(sql.getSql()); - } catch (SQLException e) { - results.add(new VerificationResultR(SQL, e.getMessage().replace("\n", ""), ERROR, DATABASE)); - } - } - } - - private TableReference getTableReference(String schemaName, String tableName) { - return new TableReferenceR(Optional.ofNullable(schemaName != null ? new SchemaReferenceR(schemaName) : null), - tableName); - } - - public List checkCatalog(DatabaseCatalog catalog) { - if (catalog.getSchemas() != null) { - catalog.getSchemas().forEach(s -> checkSchema(s)); - catalog.getSchemas().forEach(s -> checkTables(s)); - } - return results; - } - - private void checkTables(DatabaseSchema s) { - if (s != null && s.getTables() != null) { - s.getTables().forEach(t -> checkTable(s, t)); - } - } - - protected void checkPhysicalOrSystemTable(DatabaseSchema s, Table table) { - String tableName = table.getName(); - try { - TableReference tableReference = getTableReference(s.getName(), tableName); - if (!databaseService.tableExists(databaseMetaData, tableReference)) { - String msg = String.format(TABLE_S_DOES_NOT_EXIST_IN_DATABASE, tableName); - results.add(new VerificationResultR(TABLE, msg, ERROR, DATABASE)); - } else { - if (table.getColumns() != null && !table.getColumns().isEmpty()) { - table.getColumns().forEach(c -> checkColumnAttrebutes(table, c)); - table.getColumns().forEach(c -> checkColumn(table, c)); - } - } - } catch (SQLException e) { - String message = String.format(COULD_NOCH_CHECK_EXISTANCE_OF_TABLE_S, tableName); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - } - - private void checkColumn(Table table, Column column) { - try { - String schemaName = table.getSchema() != null ? table.getSchema().getName() : null; - TableReference tableReference = getTableReference(schemaName, table.getName()); - ColumnReference columnReference = new ColumnReferenceR(Optional.of(tableReference), column.getName()); - if (!databaseService.columnExists(databaseMetaData, columnReference)) { - String msg = - String.format(COLUMN_S_DOES_NOT_EXIST_IN_TABLE_S, column.getName(), table.getName()); - results.add(new VerificationResultR(TABLE, msg, ERROR, DATABASE)); - } - } catch (SQLException e) { - String msg = - String.format(COULD_NOT_LOOKUP_EXISTANCE_OF_COLUMN_S_DEFINED_IN_TABLE_S, - column.getName(), table.getName()); - results.add(new VerificationResultR(TABLE, msg, ERROR, DATABASE)); - } - } - - private void checkSqlView(DatabaseSchema s, SqlView sv) { - if (sv.getSqlStatements() != null && !sv.getSqlStatements().isEmpty()) { - - } else { - String message = String.format(SQL_VIEW_TABLE_S_STATEMENTS_NOT_DEFINED, sv.getName()); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - } - - private void checkInlineTable(DatabaseSchema s, InlineTable it) { - if (it != null) { - if (it.getColumns() != null && !it.getColumns().isEmpty()) { - it.getColumns().forEach(c -> checkColumnAttrebutes(it, c)); - checkInlineTableRows(it, it.getRows(), it.getColumns()); - } else { - String message = String.format(INLINE_TABLE_S_COLUMNS_NOT_DEFINED, it.getName()); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - } - } - - private void checkInlineTableRows(InlineTable it, List rows, List columns) { - if (rows != null && !rows.isEmpty()) { - rows.forEach(r -> checkInlineTableRow(it, r, columns)); - } else { - String message = String.format(INLINE_TABLE_S_ROWS_NOT_DEFINED, it.getName()); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - } - - private Object checkInlineTableRow(InlineTable it, Row r, List columns) { - if (r.getRowValues() != null && !r.getRowValues().isEmpty()) { - if (r.getRowValues().size() != columns.size()) { - String message = String.format(INLINE_TABLE_ROW_VALUES_SIZE_NOT_CORRECT, it.getName()); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - r.getRowValues().forEach(rv -> checkInlineTableValue(it, rv)); - } else { - String message = INLINE_TABLE_ROW_VALUES_NOT_DEFINED; - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - return null; - } - - private void checkInlineTableValue(InlineTable it, RowValue rowValue) { - - } - - private void checkColumnAttrebutes(Table it, Column column) { - if (column != null) { - if (column.getName() == null) { - String message = String.format(TABLE_S_COLUMN_NAME_NOT_DEFINED, it.getName()); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - if (column.getType() == null) { - String message = String.format(TABLE_S_COLUMN_TYPE_NOT_DEFINED, it.getName()); - results.add(new VerificationResultR(TABLE, message, ERROR, DATABASE)); - } - } - } - - protected void checkTable(DatabaseSchema s, Table table) { - if (table instanceof PhysicalTable || table instanceof SystemTable || table instanceof ViewTable) { - checkPhysicalOrSystemTable(s, table); - } - if (table instanceof InlineTable it) { - checkInlineTable(s, it); - } - if (table instanceof SqlView sv) { - checkSqlView(s, sv); - } - } - - private void checkSchema(DatabaseSchema schema) { - if (schema != null && !isEmpty(schema.getName())) { - try { - List schemaList = databaseService.getSchemas(databaseMetaData); - if (!isEmpty(schema.getName()) && !schemaList.stream().filter(sr -> schema.getName().equals(sr.name())).findFirst().isPresent()) { - String msg = String.format(SCHEMA_S_DOES_NOT_EXIST, schema); - results.add(new VerificationResultR(TABLE, msg, ERROR, DATABASE)); - } - } catch (SQLException e) { - String msg = String.format(COULD_NOT_CHECK_EXISTANCE_OF_SCHEMA_S, schema.getName()); - results.add(new VerificationResultR(SCHEMA, msg, ERROR, DATABASE)); - } - } - } - - protected static boolean isEmpty(String v) { - return (v == null) || v.equals(""); - } -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/Level.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/Level.java deleted file mode 100644 index f662648..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/Level.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.rdb.structure.check; - -public enum Level { - ERROR, WARNING, INFO, QUALITY; -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/VerificationResult.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/VerificationResult.java deleted file mode 100644 index 606df77..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/VerificationResult.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.rdb.structure.check; - -public interface VerificationResult { - - String title(); - - String description(); - - Level level(); - - Cause cause(); - -} diff --git a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/VerificationResultR.java b/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/VerificationResultR.java deleted file mode 100644 index 5bb59fe..0000000 --- a/structure.check/src/main/java/org/eclipse/daanse/rdb/structure/check/VerificationResultR.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.rdb.structure.check; - -public record VerificationResultR(String title, - String description, - Level level, - Cause cause) - implements VerificationResult { - -} diff --git a/structure.documentation/pom.xml b/structure.documentation/pom.xml deleted file mode 100644 index c0384f2..0000000 --- a/structure.documentation/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.documentation - - - - org.eclipse.daanse - org.eclipse.daanse.rdb.dbcreator - ${project.version} - - - diff --git a/structure.documentation/src/main/java/org/eclipse/daanse/rdb/structure/documentation/DocumentationProvider.java b/structure.documentation/src/main/java/org/eclipse/daanse/rdb/structure/documentation/DocumentationProvider.java deleted file mode 100644 index e3c654e..0000000 --- a/structure.documentation/src/main/java/org/eclipse/daanse/rdb/structure/documentation/DocumentationProvider.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.documentation; - - -public class DocumentationProvider { - - -} diff --git a/structure.emf/pom.xml b/structure.emf/pom.xml deleted file mode 100644 index 050bf36..0000000 --- a/structure.emf/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.emf - - - 7.1.0-SNAPSHOT - - - - - - bnd-snapshots - https://bndtools.jfrog.io/bndtools/libs-snapshot/ - default - - false - - - - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - org.geckoprojects.emf - org.gecko.emf.osgi.api - ${gecko.emf.version} - compile - - - org.geckoprojects.emf - org.gecko.emf.osgi.component - ${gecko.emf.version} - compile - - - org.eclipse.emf - org.eclipse.emf.common - ${emf.common.version} - compile - - - org.eclipse.emf - org.eclipse.emf.ecore - ${emf.ecore.version} - compile - - - org.eclipse.emf - org.eclipse.emf.ecore.xmi - ${emf.ecore.xmi.version} - compile - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - - - - biz.aQute.bnd - bnd-generate-maven-plugin - ${bnd.version} - - - - org.geckoprojects.emf - org.gecko.emf.osgi.codegen - ${gecko.emf.version} - - - - - - src/main/resources/model/org.eclipse.daanse.rdb.structure.genmodel - geckoEMF - target/generated-sources/emf - false - - - src/main/resources/model/org.eclipse.daanse.rdb.structure.genmodel - - - - - - - generate-sources - - generate - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.6.0 - - - generate-sources - - add-source - - - - target/generated-sources/emf - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - true - - - - - - diff --git a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/Constants.java b/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/Constants.java deleted file mode 100644 index 06be435..0000000 --- a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/Constants.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.emf.provider.api; - -public class Constants { - - public static final String RESOURCE_URL = "resource.url"; - - public static final String PID_EMF_DATABASE_CATALOG_PROVIDER = "org.eclipse.daanse.rdb.structure.emf.provider.EmfDatabaseStructureProvider"; - -} diff --git a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/DatabaseStructureConfig.java b/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/DatabaseStructureConfig.java deleted file mode 100644 index 22aee27..0000000 --- a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/DatabaseStructureConfig.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.emf.provider.api; - -import org.osgi.service.metatype.annotations.AttributeDefinition; -import org.osgi.service.metatype.annotations.ObjectClassDefinition; - -@ObjectClassDefinition -public @interface DatabaseStructureConfig { - - @AttributeDefinition(name = Constants.RESOURCE_URL) - String resource_url(); -} diff --git a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/package-info.java b/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/package-info.java deleted file mode 100644 index ca5884b..0000000 --- a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/api/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.rdb.structure.emf.provider.api; - diff --git a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/impl/EmfDatabaseStructureProvider.java b/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/impl/EmfDatabaseStructureProvider.java deleted file mode 100644 index 9d1da33..0000000 --- a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/impl/EmfDatabaseStructureProvider.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.emf.provider.impl; - -import java.io.IOException; -import java.util.Map; - -import org.eclipse.daanse.rdb.structure.api.DatabaseStructureProvider; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.emf.provider.api.Constants; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.RelationalDatabasePackage; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.gecko.emf.osgi.constants.EMFNamespaces; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Deactivate; -import org.osgi.service.component.annotations.Reference; -import org.osgi.service.component.annotations.ServiceScope; -import org.osgi.service.metatype.annotations.Designate; - -@Component(service = DatabaseStructureProvider.class, scope = ServiceScope.SINGLETON, configurationPid = Constants.PID_EMF_DATABASE_CATALOG_PROVIDER) -@Designate(factory = true, ocd = org.eclipse.daanse.rdb.structure.emf.provider.api.DatabaseStructureConfig.class) -public class EmfDatabaseStructureProvider implements DatabaseStructureProvider { - - @Reference(target = "(" + EMFNamespaces.EMF_MODEL_NAME + "=" + RelationalDatabasePackage.eNAME + ")") - private ResourceSet resourceSet; - - private DatabaseCatalog databaseCatalog; - - @Activate - public void activate(org.eclipse.daanse.rdb.structure.emf.provider.api.DatabaseStructureConfig config) throws IOException { - - URI uri = URI.createURI(config.resource_url()); - - Resource resource = resourceSet.getResource(uri, true); - resource.load(Map.of()); - - EObject root = resource.getContents().get(0); - - if (root instanceof DatabaseCatalog databaseCatalog) { - this.databaseCatalog = databaseCatalog; - } - } - - private void cleanAllResources() { - resourceSet.getResources().forEach(Resource::unload); - } - - @Deactivate - public void deactivate() { - cleanAllResources(); - } - - @Override - public DatabaseCatalog get() { - return databaseCatalog; - } -} diff --git a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/impl/package-info.java b/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/impl/package-info.java deleted file mode 100644 index cd8da61..0000000 --- a/structure.emf/src/main/java/org/eclipse/daanse/rdb/structure/emf/provider/impl/package-info.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.emf.provider.impl; diff --git a/structure.emf/src/main/resources/model/org.eclipse.daanse.rdb.structure.ecore b/structure.emf/src/main/resources/model/org.eclipse.daanse.rdb.structure.ecore deleted file mode 100644 index 63dc691..0000000 --- a/structure.emf/src/main/resources/model/org.eclipse.daanse.rdb.structure.ecore +++ /dev/null @@ -1,121 +0,0 @@ - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/structure.emf/src/main/resources/model/org.eclipse.daanse.rdb.structure.genmodel b/structure.emf/src/main/resources/model/org.eclipse.daanse.rdb.structure.genmodel deleted file mode 100644 index 164d53b..0000000 --- a/structure.emf/src/main/resources/model/org.eclipse.daanse.rdb.structure.genmodel +++ /dev/null @@ -1,90 +0,0 @@ - - - - org.eclipse.daanse.rdb.structure.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/AnnotationHelper.java b/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/AnnotationHelper.java deleted file mode 100644 index e8afb11..0000000 --- a/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/AnnotationHelper.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.emf; - -import static org.osgi.test.common.annotation.Property.ValueSource.SystemProperty; -import static org.osgi.test.common.annotation.Property.ValueSource.TestClass; -import static org.osgi.test.common.annotation.Property.ValueSource.TestMethod; -import static org.osgi.test.common.annotation.Property.ValueSource.TestUniqueId; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -import org.eclipse.daanse.rdb.structure.emf.provider.api.Constants; -import org.osgi.test.common.annotation.Property; -import org.osgi.test.common.annotation.Property.TemplateArgument; -import org.osgi.test.common.annotation.config.WithFactoryConfiguration; - -public class AnnotationHelper { - - public static final String PREFIX_MARKER_TESTING = "marker.testing."; - public static final String MARKER_TEST_CLASS = PREFIX_MARKER_TESTING + "TestClass"; - public static final String MARKER_TEST_METHOD = PREFIX_MARKER_TESTING + "TestMethod"; - public static final String MARKER_TEST_UNIQUEID = PREFIX_MARKER_TESTING + "TestUniqueId"; - public static final String MARKER_TEST_UNIQUEID_HEX = PREFIX_MARKER_TESTING + "TestUniqueId.hex"; - - @WithFactoryConfiguration(location = "?", factoryPid = Constants.PID_EMF_DATABASE_CATALOG_PROVIDER, properties = { - @Property(key = Constants.RESOURCE_URL, value = "file:///%s/target/test-classes/%s/%s/instance.xmi", // - templateArguments = { // - @TemplateArgument(source = SystemProperty, value = "basePath"), // - @TemplateArgument(source = TestClass), // - @TemplateArgument(source = TestMethod) }), - @Property(key = MARKER_TEST_CLASS, source = TestClass), // - @Property(key = MARKER_TEST_METHOD, source = TestMethod), // - @Property(key = MARKER_TEST_UNIQUEID, source = TestUniqueId), // - @Property(key = MARKER_TEST_UNIQUEID_HEX, value = "%h", templateArguments = @TemplateArgument(source = TestUniqueId)), // - }) - @Retention(RetentionPolicy.RUNTIME) - public @interface SetupMappingProviderWithTestInstance { - } -} diff --git a/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/TestClass.java b/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/TestClass.java deleted file mode 100644 index c7866ad..0000000 --- a/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/TestClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.emf; - -import org.junit.jupiter.api.Test; - -public class TestClass { - - @Test - void testName() throws Exception { - - } -} diff --git a/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/provider/EmfDatabaseStructureProviderTest.java b/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/provider/EmfDatabaseStructureProviderTest.java deleted file mode 100644 index 12ae206..0000000 --- a/structure.emf/src/test/java/org/eclipse/daanse/rdb/structure/emf/provider/EmfDatabaseStructureProviderTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.rdb.structure.emf.provider; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.DatabaseStructureProvider; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.PhysicalTable; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.eclipse.daanse.rdb.structure.emf.AnnotationHelper.SetupMappingProviderWithTestInstance; -import org.gecko.emf.osgi.annotation.require.RequireEMF; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.osgi.service.cm.annotations.RequireConfigurationAdmin; -import org.osgi.service.component.annotations.RequireServiceComponentRuntime; -import org.osgi.test.common.annotation.InjectService; -import org.osgi.test.common.service.ServiceAware; -import org.osgi.test.junit5.cm.ConfigurationExtension; -import org.osgi.test.junit5.context.BundleContextExtension; -import org.osgi.test.junit5.service.ServiceExtension; - -@ExtendWith(BundleContextExtension.class) -@ExtendWith(ServiceExtension.class) -@ExtendWith(ConfigurationExtension.class) -@RequireEMF -@RequireConfigurationAdmin -@RequireServiceComponentRuntime -public class EmfDatabaseStructureProviderTest { - - private static String BASE_DIR = System.getProperty("basePath"); - - @SetupMappingProviderWithTestInstance - @Test - public void loadSimpleFile( - @InjectService(cardinality = 1, timeout = 2000) ServiceAware saProvider) - throws SQLException, InterruptedException, IOException { - assertThat(saProvider.getServices()).hasSize(1); - - DatabaseStructureProvider provider = saProvider.getService(); - - DatabaseCatalog databaseCatalog = provider.get(); - List dbSchemas = databaseCatalog.getSchemas(); - - assertThat(dbSchemas).hasSize(1); - DatabaseSchema dbSchema = dbSchemas.get(0); - assertThat(dbSchema).extracting(DatabaseSchema::getName).isEqualTo("s1n"); - - List tables = dbSchema.getTables(); - - assertThat(tables).hasSize(2); - - Table pt1 = tables.get(0); - assertThat(pt1).isInstanceOf(PhysicalTable.class).extracting(Table::getName).isEqualTo("pt1n"); - - Table pt2 = tables.get(1); - assertThat(pt2).isInstanceOf(PhysicalTable.class).extracting(Table::getName).isEqualTo("pt2n"); - - } - -} diff --git a/structure.emf/src/test/resources/org.eclipse.daanse.rdb.structure.emf.provider.EmfDatabaseStructureProviderTest/loadSimpleFile/instance.xmi b/structure.emf/src/test/resources/org.eclipse.daanse.rdb.structure.emf.provider.EmfDatabaseStructureProviderTest/loadSimpleFile/instance.xmi deleted file mode 100644 index c017ed4..0000000 --- a/structure.emf/src/test/resources/org.eclipse.daanse.rdb.structure.emf.provider.EmfDatabaseStructureProviderTest/loadSimpleFile/instance.xmi +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - 255 - - - - - 255 - - - - - diff --git a/structure.emf/test.bndrun b/structure.emf/test.bndrun deleted file mode 100644 index a680fa8..0000000 --- a/structure.emf/test.bndrun +++ /dev/null @@ -1,80 +0,0 @@ -#******************************************************************************* -# Copyright (c) 2004 Contributors to the Eclipse Foundation -# -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# SmartCity Jena - initial -# Stefan Bischof (bipolis.org) - initial -#******************************************************************************* - --runstartlevel: \ - order=sortbynameversion,\ - begin=-1 - --runtrace: true - --tester: biz.aQute.tester.junit-platform - -# JaCoCo calculates test coverage --runpath.jacoco:\ - org.jacoco.agent,\ - org.jacoco.agent.rt - --runvm.coverage: -javaagent:${repo;org.jacoco.agent.rt}=destfile=${target-dir}/jacoco.exec --runvm.base: -DbasePath=${.} - --runpath.log: \ - ch.qos.logback.classic,\ - ch.qos.logback.core,\ - slf4j.api - --runproperties.logback:\ - org.osgi.framework.bootdelegation=org.mockito.internal.creation.bytebuddy.inject,\ - logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml - --runsystemcapabilities: ${native_capability} - --resolve.effective: active - - --runfw: org.apache.felix.framework - --runee: JavaSE-21 - --runrequires: \ - bnd.identity;id='${project.artifactId}-tests',\ - bnd.identity;id='${project.artifactId}' - -# -runbundles is calculated by the bnd-resolver-maven-plugin --runbundles: \ - assertj-core;version='[3.26.0,3.26.1)',\ - junit-jupiter-api;version='[5.10.2,5.10.3)',\ - junit-jupiter-engine;version='[5.10.2,5.10.3)',\ - junit-jupiter-params;version='[5.10.2,5.10.3)',\ - junit-platform-commons;version='[1.10.2,1.10.3)',\ - junit-platform-engine;version='[1.10.2,1.10.3)',\ - junit-platform-launcher;version='[1.10.2,1.10.3)',\ - net.bytebuddy.byte-buddy;version='[1.14.16,1.14.17)',\ - org.apache.felix.configadmin;version='[1.9.26,1.9.27)',\ - org.apache.felix.scr;version='[2.2.10,2.2.11)',\ - org.eclipse.daanse.rdb.structure.api;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.rdb.structure.emf;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.rdb.structure.emf-tests;version='[0.0.1,0.0.2)',\ - org.eclipse.emf.common;version='[2.30.0,2.30.1)',\ - org.eclipse.emf.ecore;version='[2.36.0,2.36.1)',\ - org.eclipse.emf.ecore.xmi;version='[2.37.0,2.37.1)',\ - org.gecko.emf.osgi.component;version='[6.1.3,6.1.4)',\ - org.opentest4j;version='[1.3.0,1.3.1)',\ - org.osgi.service.cm;version='[1.6.1,1.6.2)',\ - org.osgi.service.component;version='[1.5.1,1.5.2)',\ - org.osgi.test.common;version='[1.3.0,1.3.1)',\ - org.osgi.test.junit5;version='[1.3.0,1.3.1)',\ - org.osgi.test.junit5.cm;version='[1.3.0,1.3.1)',\ - org.osgi.util.converter;version='[1.0.9,1.0.10)',\ - org.osgi.util.function;version='[1.2.0,1.2.1)',\ - org.osgi.util.promise;version='[1.3.0,1.3.1)' \ No newline at end of file diff --git a/structure.modifier.base/pom.xml b/structure.modifier.base/pom.xml deleted file mode 100644 index 2fbad2b..0000000 --- a/structure.modifier.base/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.modifier.base - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - diff --git a/structure.modifier.base/src/main/java/org/eclipse/daanse/rdb/structure/modifier/base/AbstractMappingModifier.java b/structure.modifier.base/src/main/java/org/eclipse/daanse/rdb/structure/modifier/base/AbstractMappingModifier.java deleted file mode 100644 index 18d9930..0000000 --- a/structure.modifier.base/src/main/java/org/eclipse/daanse/rdb/structure/modifier/base/AbstractMappingModifier.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.rdb.structure.modifier.base; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.DatabaseStructureProvider; -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.InlineTable; -import org.eclipse.daanse.rdb.structure.api.model.Link; -import org.eclipse.daanse.rdb.structure.api.model.PhysicalTable; -import org.eclipse.daanse.rdb.structure.api.model.Row; -import org.eclipse.daanse.rdb.structure.api.model.RowValue; -import org.eclipse.daanse.rdb.structure.api.model.SqlStatement; -import org.eclipse.daanse.rdb.structure.api.model.SqlView; -import org.eclipse.daanse.rdb.structure.api.model.SystemTable; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.eclipse.daanse.rdb.structure.api.model.ViewTable; - -public abstract class AbstractMappingModifier implements DatabaseStructureProvider { - - protected DatabaseCatalog catalog; - - protected AbstractMappingModifier(DatabaseCatalog catalog) { - super(); - this.catalog = catalog; - } - - public DatabaseCatalog get() { - return modifyCatalog(catalog); - } - - protected DatabaseCatalog modifyCatalog(DatabaseCatalog catalog2) { - if (catalog2 != null) { - List schemas = databaseCatalogSchemas(catalog2); - List links = databaseCatalogLinks(catalog2); - return createCatalog(schemas, links); - } - return null; - } - - protected List databaseCatalogLinks(DatabaseCatalog catalog2) { - return links(catalog2.getLinks()); - } - - protected List links(List links) { - if (links != null) { - return links.stream().map(this::link).toList(); - } - return null; - } - - protected Link link(Link link) { - if (link != null) { - Column primaryKey = linkPrimaryKey(link); - Column foreignKey = linkForeignKey(link); - return createLink(primaryKey, foreignKey); - } - return null; - } - - protected abstract Link createLink(Column primaryKey, Column foreignKey); - - protected Column linkForeignKey(Link link) { - return column(link.getForeignKey()); - } - - protected Column column(Column column) { - if (column != null) { - String name = columnName(column); - Table table = columnTable(column); - String type = columnType(column); - String description = columnDescription(column); - return createColumn(name, table, type, description); - } - return null; - } - - protected abstract Column createColumn( - String name, Table table, String type, - String description - ); - - protected String columnDescription(Column column) { - return column.getDescription(); - } - - protected List typeQualifiers(List typeQualifiers) { - if (typeQualifiers != null) { - return typeQualifiers.stream().map(t -> t).toList(); - } - return List.of(); - } - - protected String columnType(Column column) { - return column.getType(); - } - - protected Table columnTable(Column column) { - return table(column.getTable()); - } - - protected Table table(Table table) { - if (table != null) { - String name = tableName(table); - List columns = tableColumns(table); - DatabaseSchema schema = tableSchema(table); - String description = tableDescription(table); - if (table instanceof PhysicalTable) { - return createPhysicalTable(name, columns, schema, description); - } - if (table instanceof SystemTable) { - return createSystemTable(name, columns, schema, description); - } - if (table instanceof ViewTable) { - return createViewTable(name, columns, schema, description); - } - if (table instanceof InlineTable it) { - List rows = inlineTableRows(it); - return createInlineTable(name, columns, schema, description, rows); - } - if (table instanceof SqlView sv) { - List sqlStatements = sqlViewSqlStatements(sv); - return createSqlView(name, columns, schema, description, sqlStatements); - } - } - return null; - } - - protected List sqlViewSqlStatements(SqlView sv) { - if (sv != null) { - return sqlStatements(sv.getSqlStatements()); - } - return List.of(); - } - - protected List sqlStatements(List sqlStatements) { - if (sqlStatements != null) { - return sqlStatements.stream().map(this::sqlStatement).toList(); - } - return List.of(); - } - - protected SqlStatement sqlStatement(SqlStatement sqlStatement) { - if (sqlStatement != null) { - List dialects = sqlStatementDdialects(sqlStatement); - String sql = sqlStatementSql(sqlStatement); - return createSqlStatement(dialects, sql); - } - return null; - } - - protected List sqlStatementDdialects(SqlStatement sqlStatement) { - return dialects(sqlStatement.getDialects()); - } - - protected List dialects(List dialects) { - if (dialects != null) { - return dialects.stream().map(String::new).toList(); - } - return List.of(); - } - - protected String sqlStatementSql(SqlStatement sqlStatement) { - return sqlStatement.getSql(); - } - - protected abstract SqlStatement createSqlStatement(List dialects, String sql); - - protected abstract Table createSqlView( - String name, List columns, DatabaseSchema schema, - String description, List sqlStatements - ); - - protected abstract Table createInlineTable( - String name, List columns, DatabaseSchema schema, - String description, List rows - ); - - protected List inlineTableRows(InlineTable it) { - if (it != null) { - return rows(it.getRows()); - } - return List.of(); - } - - protected List rows(List rows) { - if (rows != null) { - return rows.stream().map(this::row).toList(); - } - return List.of(); - } - - protected Row row(Row r) { - if (r != null) { - List rowValues = rowRowValue(r); - return createRow(rowValues); - } - return null; - } - - protected List rowRowValue(Row r) { - return rowValue(r.getRowValues()); - } - - protected List rowValue(List rowValues) { - if (rowValues != null) { - return rowValues.stream().map(this::rowValue).toList(); - } - return List.of(); - } - - protected RowValue rowValue(RowValue rowValue) { - if (rowValue != null) { - Column column = rowValueColumn(rowValue); - String value = rowValueValue(rowValue); - return createRowValue(column, value); - } - return null; - } - - protected abstract RowValue createRowValue(Column column, String value); - - protected String rowValueValue(RowValue rowValue) { - return rowValue.getValue(); - } - - protected Column rowValueColumn(RowValue rowValue) { - return column(rowValue.getColumn()); - } - - protected abstract Row createRow(List rowValues); - - protected abstract ViewTable createViewTable( - String name, List columns, DatabaseSchema schema, - String description - ); - - protected abstract SystemTable createSystemTable( - String name, List columns, DatabaseSchema schema, - String description - ); - - protected abstract PhysicalTable createPhysicalTable( - String name, List columns, DatabaseSchema schema, - String description - ); - - protected String tableDescription(Table table) { - return table.getDescription(); - } - - protected DatabaseSchema tableSchema(Table table) { - return databaseSchema(table.getSchema()); - } - - protected DatabaseSchema databaseSchema(DatabaseSchema schema) { - if (schema != null) { - List tables = schemaTables(schema); - String name = schemaName(schema); - String id = schemaId(schema); - return createDatabaseSchema(tables, name, id); - } - return null; - } - - protected String schemaId(DatabaseSchema schema) { - return schema.getId(); - } - - protected String schemaName(DatabaseSchema schema) { - return schema.getName(); - } - - protected List schemaTables(DatabaseSchema schema) { - return tables(schema.getTables()); - } - - protected List tables(List tables) { - if (tables != null) { - return tables.stream().map(this::table).toList(); - } - return null; - } - - protected abstract DatabaseSchema createDatabaseSchema(List tables, String name, String id); - - protected List tableColumns(Table table) { - return columns(table.getColumns()); - } - - protected List columns(List columns) { - if (columns != null) { - return columns.stream().map(this::column).toList(); - } - return null; - } - - protected String tableName(Table table) { - return table.getName(); - } - - protected String columnName(Column column) { - return column.getName(); - } - - protected Column linkPrimaryKey(Link link) { - return column(link.getPrimaryKey()); - } - - protected abstract DatabaseCatalog createCatalog( - List schemas, - List links - ); - - protected List databaseCatalogSchemas(DatabaseCatalog catalog2) { - return databaseSchemas(catalog2.getSchemas()); - } - - protected List databaseSchemas(List schemas) { - if (schemas != null) { - return schemas.stream().map(this::databaseSchema).toList(); - } - return null; - }} diff --git a/structure.modifier.base/src/main/java/org/eclipse/daanse/rdb/structure/modifier/base/package-info.java b/structure.modifier.base/src/main/java/org/eclipse/daanse/rdb/structure/modifier/base/package-info.java deleted file mode 100644 index 8756fa6..0000000 --- a/structure.modifier.base/src/main/java/org/eclipse/daanse/rdb/structure/modifier/base/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.rdb.structure.modifier.base; diff --git a/structure.modifier.emf/pom.xml b/structure.modifier.emf/pom.xml deleted file mode 100644 index 40632f0..0000000 --- a/structure.modifier.emf/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.modifier.emf - - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.emf - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.modifier.base - ${project.version} - - - diff --git a/structure.modifier.emf/src/main/java/org/eclipse/daanse/rdb/structure/modifier/emf/EmfMappingModifier.java b/structure.modifier.emf/src/main/java/org/eclipse/daanse/rdb/structure/modifier/emf/EmfMappingModifier.java deleted file mode 100644 index 2b29c0c..0000000 --- a/structure.modifier.emf/src/main/java/org/eclipse/daanse/rdb/structure/modifier/emf/EmfMappingModifier.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.modifier.emf; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.daanse.rdb.structure.modifier.base.AbstractMappingModifier; -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.Link; -import org.eclipse.daanse.rdb.structure.api.model.PhysicalTable; -import org.eclipse.daanse.rdb.structure.api.model.Row; -import org.eclipse.daanse.rdb.structure.api.model.RowValue; -import org.eclipse.daanse.rdb.structure.api.model.SqlStatement; -import org.eclipse.daanse.rdb.structure.api.model.SystemTable; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.eclipse.daanse.rdb.structure.api.model.ViewTable; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.RelationalDatabaseFactory; - -public class EmfMappingModifier extends AbstractMappingModifier { - - protected EmfMappingModifier(DatabaseCatalog catalog) { - super(catalog); - } - - @Override - protected Link createLink(Column primaryKey, Column foreignKey) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.Link link = RelationalDatabaseFactory.eINSTANCE.createLink(); - link.setPrimaryKey((org.eclipse.daanse.rdb.structure.emf.rdbstructure.Column) primaryKey); - link.setForeignKey((org.eclipse.daanse.rdb.structure.emf.rdbstructure.Column) foreignKey); - return link; - } - - @Override - protected Column createColumn(String name, Table table, String type, String description) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.Column column = RelationalDatabaseFactory.eINSTANCE - .createColumn(); - column.setName(name); - column.setTable((org.eclipse.daanse.rdb.structure.emf.rdbstructure.Table) table); - column.setType(type); - column.setDescription(description); - return column; - } - - @SuppressWarnings("unchecked") - @Override - protected ViewTable createViewTable(String name, List columns, DatabaseSchema schema, - String description) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.ViewTable viewTable = RelationalDatabaseFactory.eINSTANCE - .createViewTable(); - viewTable.setName(name); - viewTable.getColumns() - .addAll((Collection) columns); - viewTable.setSchema((org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema) schema); - viewTable.setDescription(description); - return viewTable; - } - - @SuppressWarnings("unchecked") - @Override - protected SystemTable createSystemTable(String name, List columns, DatabaseSchema schema, - String description) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.SystemTable systemTable = RelationalDatabaseFactory.eINSTANCE - .createSystemTable(); - systemTable.setName(name); - systemTable.getColumns() - .addAll((Collection) columns); - systemTable.setSchema((org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema) schema); - systemTable.setDescription(description); - return systemTable; - } - - @SuppressWarnings("unchecked") - @Override - protected PhysicalTable createPhysicalTable(String name, List columns, DatabaseSchema schema, - String description) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.PhysicalTable physicalTable = RelationalDatabaseFactory.eINSTANCE - .createPhysicalTable(); - physicalTable.setName(name); - physicalTable.getColumns() - .addAll((Collection) columns); - physicalTable.setSchema((org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema) schema); - physicalTable.setDescription(description); - return physicalTable; - } - - @SuppressWarnings("unchecked") - @Override - protected DatabaseSchema createDatabaseSchema(List tables, String name, String id) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema databaseSchema = RelationalDatabaseFactory.eINSTANCE - .createDatabaseSchema(); - databaseSchema.getTables() - .addAll((Collection) tables); - databaseSchema.setName(name); - databaseSchema.setId(id); - return databaseSchema; - } - - @SuppressWarnings("unchecked") - @Override - protected DatabaseCatalog createCatalog(List schemas, List links) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseCatalog databaseCatalog = RelationalDatabaseFactory.eINSTANCE - .createDatabaseCatalog(); - databaseCatalog.getSchemas() - .addAll((Collection) schemas); - databaseCatalog.getLinks() - .addAll((Collection) links); - return databaseCatalog; - } - - @Override - protected SqlStatement createSqlStatement(List dialects, String sql) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.SqlStatement sqlStatement = RelationalDatabaseFactory.eINSTANCE - .createSqlStatement(); - sqlStatement.getDialects().addAll(dialects); - sqlStatement.setSql(sql); - return sqlStatement; - } - - @SuppressWarnings("unchecked") - @Override - protected Table createSqlView( - String name, List columns, DatabaseSchema schema, - String description, List sqlStatements - ) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.SqlView sqlView = RelationalDatabaseFactory.eINSTANCE - .createSqlView(); - sqlView.setName(name); - sqlView.getColumns().addAll((Collection) columns); - sqlView.setSchema((org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema) schema); - sqlView.setDescription(description); - sqlView.getSqlStatements().addAll((Collection) sqlStatements); - return sqlView; - } - - @SuppressWarnings("unchecked") - @Override - protected Table createInlineTable( - String name, List columns, DatabaseSchema schema, - String description, List rows - ) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.InlineTable inlineTable = RelationalDatabaseFactory.eINSTANCE - .createInlineTable(); - inlineTable.setName(name); - inlineTable.getColumns().addAll((Collection) columns); - inlineTable.setSchema((org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema) schema); - inlineTable.setDescription(description); - inlineTable.getRows().addAll((Collection) rows); - return inlineTable; - } - - @SuppressWarnings("unchecked") - @Override - protected RowValue createRowValue(Column column, String value) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.RowValue rowValue = RelationalDatabaseFactory.eINSTANCE - .createRowValue(); - rowValue.setColumn((org.eclipse.daanse.rdb.structure.emf.rdbstructure.Column) column); - rowValue.setValue(value); - return rowValue; - } - - @SuppressWarnings("unchecked") - @Override - protected Row createRow(List rowValues) { - org.eclipse.daanse.rdb.structure.emf.rdbstructure.Row row = RelationalDatabaseFactory.eINSTANCE - .createRow(); - row.getRowValues().addAll((Collection) rowValues); - return row; - } -} diff --git a/structure.modifier.pojo/pom.xml b/structure.modifier.pojo/pom.xml deleted file mode 100644 index 64cba29..0000000 --- a/structure.modifier.pojo/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.modifier.pojo - - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.modifier.base - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.pojo - ${project.version} - - - diff --git a/structure.modifier.pojo/src/main/java/org/eclipse/daanse/rdb/structure/modifier/pojo/PojoMappingModifier.java b/structure.modifier.pojo/src/main/java/org/eclipse/daanse/rdb/structure/modifier/pojo/PojoMappingModifier.java deleted file mode 100644 index c79aa57..0000000 --- a/structure.modifier.pojo/src/main/java/org/eclipse/daanse/rdb/structure/modifier/pojo/PojoMappingModifier.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.modifier.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.Link; -import org.eclipse.daanse.rdb.structure.api.model.PhysicalTable; -import org.eclipse.daanse.rdb.structure.api.model.Row; -import org.eclipse.daanse.rdb.structure.api.model.RowValue; -import org.eclipse.daanse.rdb.structure.api.model.SqlStatement; -import org.eclipse.daanse.rdb.structure.api.model.SystemTable; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.eclipse.daanse.rdb.structure.api.model.ViewTable; -import org.eclipse.daanse.rdb.structure.modifier.base.AbstractMappingModifier; -import org.eclipse.daanse.rdb.structure.pojo.AbstractTable; -import org.eclipse.daanse.rdb.structure.pojo.ColumnImpl; -import org.eclipse.daanse.rdb.structure.pojo.DatabaseCatalogImpl; -import org.eclipse.daanse.rdb.structure.pojo.DatabaseSchemaImpl; -import org.eclipse.daanse.rdb.structure.pojo.LinkImpl; -import org.eclipse.daanse.rdb.structure.pojo.PhysicalTableImpl; -import org.eclipse.daanse.rdb.structure.pojo.RowImpl; -import org.eclipse.daanse.rdb.structure.pojo.RowValueImpl; -import org.eclipse.daanse.rdb.structure.pojo.SqlStatementImpl; -import org.eclipse.daanse.rdb.structure.pojo.SqlViewImpl; -import org.eclipse.daanse.rdb.structure.pojo.SystemTableImpl; -import org.eclipse.daanse.rdb.structure.pojo.ViewTableImpl; -import org.eclipse.daanse.rdb.structure.pojo.InlineTableImpl; - -public class PojoMappingModifier extends AbstractMappingModifier { - - public PojoMappingModifier(DatabaseCatalog catalog) { - super(catalog); - } - - @Override - protected Link createLink(Column primaryKey, Column foreignKey) { - LinkImpl link = LinkImpl.builder().build(); - link.setPrimaryKey((ColumnImpl) primaryKey); - link.setForeignKey((ColumnImpl) foreignKey); - return link; - } - - @Override - protected Column createColumn( - String name, Table table, String type, - String description - ) { - ColumnImpl column = ColumnImpl.builder().build(); - column.setName(name); - column.setTable(table); - column.setType(type); - column.setDescription(description); - return column; - - } - - @SuppressWarnings("unchecked") - @Override - protected PhysicalTable createPhysicalTable( - String name, List columns, DatabaseSchema schema, - String description - ) { - PhysicalTableImpl table = PhysicalTableImpl.builder().build(); - table.setName(name); - table.setColumns((List) columns); - table.setSchema((DatabaseSchemaImpl) schema); - table.setDescription(description); - return table; - } - - @SuppressWarnings("unchecked") - @Override - protected SystemTable createSystemTable( - String name, List columns, DatabaseSchema schema, - String description - ) { - SystemTableImpl table = SystemTableImpl.builder().build(); - table.setName(name); - table.setColumns((List) columns); - table.setSchema((DatabaseSchemaImpl) schema); - table.setDescription(description); - return table; - } - - @SuppressWarnings("unchecked") - @Override - protected ViewTable createViewTable( - String name, List columns, DatabaseSchema schema, - String description - ) { - ViewTableImpl table = ViewTableImpl.builder().build(); - table.setName(name); - table.setColumns((List) columns); - table.setSchema((DatabaseSchemaImpl) schema); - table.setDescription(description); - return table; - } - - @SuppressWarnings("unchecked") - @Override - protected DatabaseSchema createDatabaseSchema(List tables, String name, String id) { - DatabaseSchemaImpl databaseSchema = DatabaseSchemaImpl.builder().build(); - databaseSchema.setTables((List) tables); - databaseSchema.setName(name); - databaseSchema.setId(id); - return databaseSchema; - } - - @SuppressWarnings("unchecked") - @Override - protected DatabaseCatalog createCatalog(List schemas, List links) { - DatabaseCatalogImpl databaseCatalog = DatabaseCatalogImpl.builder().build(); - databaseCatalog.setSchemas((List) schemas); - databaseCatalog.setLinks((List) links); - return databaseCatalog; - } - - @Override - protected SqlStatement createSqlStatement(List dialects, String sql) { - SqlStatementImpl sqlStatement = SqlStatementImpl.builder().build(); - sqlStatement.setDialects(dialects); - sqlStatement.setSql(sql); - return sqlStatement; - } - - @SuppressWarnings("unchecked") - @Override - protected Table createSqlView( - String name, List columns, DatabaseSchema schema, - String description, List sqlStatements - ) { - SqlViewImpl sqlView = SqlViewImpl.builder().build(); - sqlView.setName(name); - sqlView.setColumns((List) columns); - sqlView.setSchema((DatabaseSchemaImpl) schema); - sqlView.setDescription(description); - sqlView.setSqlStatements(sqlStatements); - return sqlView; - } - - @SuppressWarnings("unchecked") - @Override - protected Table createInlineTable( - String name, List columns, DatabaseSchema schema, - String description, List rows - ) { - InlineTableImpl inlineTable = InlineTableImpl.builder().build(); - inlineTable.setName(name); - inlineTable.setColumns((List) columns); - inlineTable.setSchema((DatabaseSchemaImpl) schema); - inlineTable.setDescription(description); - inlineTable.setRows(rows); - return inlineTable; - } - - @Override - protected RowValue createRowValue(Column column, String value) { - RowValueImpl rowValue = RowValueImpl.builder().build(); - rowValue.setColumn(column); - rowValue.setValue(value); - return rowValue; - } - - @Override - protected Row createRow(List rowValues) { - RowImpl row = RowImpl.builder().build(); - row.setRowValues(rowValues); - return row; - } - -} diff --git a/structure.modifier.pojo/src/main/java/org/eclipse/daanse/rdb/structure/modifier/pojo/package-info.java b/structure.modifier.pojo/src/main/java/org/eclipse/daanse/rdb/structure/modifier/pojo/package-info.java deleted file mode 100644 index dc6fca1..0000000 --- a/structure.modifier.pojo/src/main/java/org/eclipse/daanse/rdb/structure/modifier/pojo/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.rdb.structure.modifier.pojo; diff --git a/structure.pojo/pom.xml b/structure.pojo/pom.xml deleted file mode 100644 index c7f91f3..0000000 --- a/structure.pojo/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.pojo - - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - - diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/AbstractTable.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/AbstractTable.java deleted file mode 100644 index 23b2cf2..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/AbstractTable.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.Table; - -public abstract class AbstractTable implements Table { - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getColumns() { - return columns; - } - - public void setColumns(List columns) { - this.columns = columns; - } - - public DatabaseSchemaImpl getSchema() { - return schema; - } - - public void setSchema(DatabaseSchemaImpl schema) { - this.schema = schema; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - private String name; - - private List columns; - - private DatabaseSchemaImpl schema; - - private String description; - - public static abstract class AbstractBuilder> { - - private String name; - - private List columns; - - private DatabaseSchemaImpl schema; - - private String description; - - public B withName(String name) { - this.name = name; - return (B) this; - } - - public B withColumns(List columns) { - this.columns = columns; - return (B) this; - } - - public B withsSchema(DatabaseSchemaImpl schema) { - this.schema = schema; - return (B) this; - } - - public B withsDdescription(String description) { - this.description = description; - return (B) this; - } - - public String getName() { - return name; - } - - public List getColumns() { - return columns; - } - - public DatabaseSchemaImpl getSchema() { - return schema; - } - - public String getDescription() { - return description; - } - } - -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/ColumnImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/ColumnImpl.java deleted file mode 100644 index 002f117..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/ColumnImpl.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.Table; - -public class ColumnImpl implements Column { - - public ColumnImpl(Builder builder) { - this.name = builder.name; - this.table = builder.table; - this.type = builder.type; - this.nullable = builder.nullable; - this.charOctetLength = builder.charOctetLength; - this.numPrecRadix = builder.numPrecRadix; - this.columnSize = builder.columnSize; - this.decimalDigits = builder.decimalDigits; - this.description = builder.description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Table getTable() { - return table; - } - - public void setTable(Table table) { - this.table = table; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public void setNullable(boolean nullable) { - this.nullable = nullable; - } - - public void setCharOctetLength(int charOctetLength) { - this.charOctetLength = charOctetLength; - } - - public void setNumPrecRadix(int numPrecRadix) { - this.numPrecRadix = numPrecRadix; - } - - public void setColumnSize(Integer columnSize) { - this.columnSize = columnSize; - } - - public void setDecimalDigits(Integer decimalDigits) { - this.decimalDigits = decimalDigits; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - private String name; - - private Table table; - - private String type; - - private boolean nullable; - - private int charOctetLength; - - private int numPrecRadix; - - private Integer columnSize; - - private Integer decimalDigits; - - private String description; - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - - private String name; - - private Table table; - - private String type; - - private String description; - - private boolean nullable; - - private int charOctetLength; - - private int numPrecRadix; - - private Integer columnSize; - - private Integer decimalDigits; - - public Builder withName(String name) { - this.name = name; - return this; - } - - public Builder withTable(Table table) { - this.table = table; - return this; - } - - public Builder withType(String type) { - this.type = type; - return this; - } - - public Builder withDecimalDigits(Integer decimalDigits) { - this.decimalDigits = decimalDigits; - return this; - } - - public Builder withColumnSize(Integer columnSize) { - this.columnSize = columnSize; - return this; - } - - public Builder withNumPrecRadix(int numPrecRadix) { - this.numPrecRadix = numPrecRadix; - return this; - } - - public Builder withCharOctetLength(int charOctetLength) { - this.charOctetLength = charOctetLength; - return this; - } - - public Builder withNullable(boolean nullable) { - this.nullable = nullable; - return this; - } - - public Builder withDescription(String description) { - this.description = description; - return this; - } - - public ColumnImpl build() { - return new ColumnImpl(this); - } - } - - @Override - public Integer getColumnSize() { - return columnSize; - } - - @Override - public Integer getDecimalDigits() { - return decimalDigits; - } - - @Override - public Integer getNumPrecRadix() { - return numPrecRadix; - } - - @Override - public Integer getCharOctetLength() { - return charOctetLength; - } - - @Override - public Boolean getNullable() { - return nullable; - } - -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/DatabaseCatalogImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/DatabaseCatalogImpl.java deleted file mode 100644 index 1c2be2d..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/DatabaseCatalogImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; - -public class DatabaseCatalogImpl implements DatabaseCatalog { - - private List schemas; - - public DatabaseCatalogImpl(Builder builder) { - this.schemas = builder.schemas; - this.links = builder.links; - } - - public List getSchemas() { - return schemas; - } - - public void setSchemas(List schemas) { - this.schemas = schemas; - } - - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - private List links; - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - - private List schemas; - private List links; - - public Builder withSchemas(List schemas) { - this.schemas = schemas; - return this; - } - - public Builder withLinks(List links) { - this.links = links; - return this; - } - - public DatabaseCatalogImpl build() { - return new DatabaseCatalogImpl(this); - } - } - -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/DatabaseSchemaImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/DatabaseSchemaImpl.java deleted file mode 100644 index 86b1dbc..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/DatabaseSchemaImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; - -public class DatabaseSchemaImpl implements DatabaseSchema { - - public DatabaseSchemaImpl(Builder builder) { - this.tables = builder.tables; - this.name = builder.name; - this.id = builder.id; - } - - public List getTables() { - return tables; - } - - public void setTables(List tables) { - this.tables = tables; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - private List tables; - - private String name; - - private String id; - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - - private List tables; - - private String name; - - private String id; - - public Builder withTables(List tables) { - this.tables = tables; - return this; - } - - public Builder withName(String name) { - this.name = name; - return this; - } - - public Builder withId(String id) { - this.id = id; - return this; - } - - public DatabaseSchemaImpl build() { - return new DatabaseSchemaImpl(this); - } - - } - -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/InlineTableImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/InlineTableImpl.java deleted file mode 100644 index c20164f..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/InlineTableImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.InlineTable; -import org.eclipse.daanse.rdb.structure.api.model.Row; - -public class InlineTableImpl extends AbstractTable implements InlineTable { - - private List rows; - - public static Builder builder() { - return new Builder(); - } - - public InlineTableImpl(Builder builder) { - setName(builder.name); - setColumns(builder.columns); - setSchema(builder.schema); - setDescription(builder.description); - setRows(builder.rows); - } - - @Override - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static final class Builder { - - private String name; - - private List columns; - - private DatabaseSchemaImpl schema; - - private String description; - - private List rows; - - private Builder() { - } - - public Builder withName(String name) { - this.name = name; - return this; - } - - public Builder withColumns(List columns) { - this.columns = columns; - return this; - } - - public Builder withsSchema(DatabaseSchemaImpl schema) { - this.schema = schema; - return this; - } - - public Builder withsDdescription(String description) { - this.description = description; - return this; - } - - public Builder withRows(List rows) { - this.rows = rows; - return this; - } - - public InlineTableImpl build() { - return new InlineTableImpl(this); - } - - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/LinkImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/LinkImpl.java deleted file mode 100644 index af2826a..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/LinkImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import org.eclipse.daanse.rdb.structure.api.model.Link; - -public class LinkImpl implements Link { - - public LinkImpl(Builder builder) { - this.primaryKey = builder.primaryKey; - this.foreignKey = builder.foreignKey; - } - - public ColumnImpl getPrimaryKey() { - return primaryKey; - } - - public void setPrimaryKey(ColumnImpl primaryKey) { - this.primaryKey = primaryKey; - } - - public ColumnImpl getForeignKey() { - return foreignKey; - } - - public void setForeignKey(ColumnImpl foreignKey) { - this.foreignKey = foreignKey; - } - - private ColumnImpl primaryKey; - - private ColumnImpl foreignKey; - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - - private ColumnImpl primaryKey; - - private ColumnImpl foreignKey; - - public Builder withPrimaryKey(ColumnImpl primaryKey) { - this.primaryKey = primaryKey; - return this; - } - - public Builder withForeignKey(ColumnImpl foreignKey) { - this.foreignKey = foreignKey; - return this; - } - - public LinkImpl build() { - return new LinkImpl(this); - } - } - -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/PhysicalTableImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/PhysicalTableImpl.java deleted file mode 100644 index 4a9716e..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/PhysicalTableImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import org.eclipse.daanse.rdb.structure.api.model.PhysicalTable; - -public class PhysicalTableImpl extends AbstractTable implements PhysicalTable { - - public PhysicalTableImpl(Builder builder) { - setName(builder.getName()); - setColumns(builder.getColumns()); - setSchema(builder.getSchema()); - setDescription(builder.getDescription()); - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder extends AbstractBuilder { - - private Builder() { - } - - public PhysicalTableImpl build() { - return new PhysicalTableImpl(this); - } - - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/RowImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/RowImpl.java deleted file mode 100644 index 0740dbb..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/RowImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.Row; -import org.eclipse.daanse.rdb.structure.api.model.RowValue; - -public class RowImpl implements Row { - - private List rowValues; - - public RowImpl(Builder builder) { - this.rowValues = builder.rowValues; - } - - @Override - public List getRowValues() { - return rowValues; - } - - public void setRowValues(List rowValues) { - this.rowValues = rowValues; - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - - private List rowValues; - - public Builder withRowValues(List rowValues) { - this.rowValues = rowValues; - return this; - } - - public RowImpl build() { - return new RowImpl(this); - } - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/RowValueImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/RowValueImpl.java deleted file mode 100644 index d2f3d7c..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/RowValueImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.RowValue; - -public class RowValueImpl implements RowValue { - - private Column column; - private String value; - - public RowValueImpl(Builder builder) { - this.column = builder.column; - this.value = builder.value; - } - - @Override - public Column getColumn() { - return column; - } - - @Override - public String getValue() { - return value; - } - - public void setColumn(Column column) { - this.column = column; - } - - public void setValue(String value) { - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - - private Column column; - private String value; - - public Builder withColumn(Column column) { - this.column = column; - return this; - } - - public Builder withValue(String value) { - this.value = value; - return this; - } - - public RowValueImpl build() { - return new RowValueImpl(this); - } - } - -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SqlStatementImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SqlStatementImpl.java deleted file mode 100644 index 42843ab..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SqlStatementImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.SqlStatement; - -public class SqlStatementImpl implements SqlStatement { - - private List dialects; - private String sql; - - public SqlStatementImpl(Builder builder) { - this.dialects = builder.dialects; - this.sql = builder.sql; - } - - public static Builder builder() { - return new Builder(); - } - - @Override - public List getDialects() { - return dialects; - } - - @Override - public String getSql() { - return sql; - } - - public void setDialects(List dialects) { - this.dialects = dialects; - } - - public void setSql(String sql) { - this.sql = sql; - } - - public static final class Builder { - - private List dialects; - private String sql; - - public Builder withDialects(List dialects) { - this.dialects = dialects; - return this; - } - - public Builder withSql(String sql) { - this.sql = sql; - return this; - } - - public SqlStatementImpl build() { - return new SqlStatementImpl(this); - } - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SqlViewImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SqlViewImpl.java deleted file mode 100644 index 5d5c87f..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SqlViewImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import java.util.List; - -import org.eclipse.daanse.rdb.structure.api.model.SqlStatement; -import org.eclipse.daanse.rdb.structure.api.model.SqlView; - -public class SqlViewImpl extends AbstractTable implements SqlView { - - private List sqlStatements; - - public SqlViewImpl(Builder builder) { - setName(builder.getName()); - setColumns(builder.getColumns()); - setSchema(builder.getSchema()); - setDescription(builder.getDescription()); - setSqlStatements(builder.sqlStatements); - } - - public static Builder builder() { - return new Builder(); - } - - @Override - public List getSqlStatements() { - return sqlStatements; - } - - public void setSqlStatements(List sqlStatements) { - this.sqlStatements = sqlStatements; - } - - public static final class Builder extends AbstractBuilder { - - private List sqlStatements; - - private Builder() { - } - - public Builder withSqlStatements(List sqlStatements) { - this.sqlStatements = sqlStatements; - return this; - } - - public SqlViewImpl build() { - return new SqlViewImpl(this); - } - - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SystemTableImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SystemTableImpl.java deleted file mode 100644 index f810ee5..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/SystemTableImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import org.eclipse.daanse.rdb.structure.api.model.SystemTable; - -public class SystemTableImpl extends AbstractTable implements SystemTable { - - public SystemTableImpl(Builder builder) { - setName(builder.getName()); - setColumns(builder.getColumns()); - setSchema(builder.getSchema()); - setDescription(builder.getDescription()); - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder extends AbstractBuilder { - - private Builder() { - } - - public SystemTableImpl build() { - return new SystemTableImpl(this); - } - - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/ViewTableImpl.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/ViewTableImpl.java deleted file mode 100644 index bcf843f..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/ViewTableImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.pojo; - -import org.eclipse.daanse.rdb.structure.api.model.ViewTable; - -public class ViewTableImpl extends AbstractTable implements ViewTable { - - public ViewTableImpl(Builder builder) { - setName(builder.getName()); - setColumns(builder.getColumns()); - setSchema(builder.getSchema()); - setDescription(builder.getDescription()); - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder extends AbstractBuilder { - - private Builder() { - } - - public ViewTableImpl build() { - return new ViewTableImpl(this); - } - } -} diff --git a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/package-info.java b/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/package-info.java deleted file mode 100644 index 64e627e..0000000 --- a/structure.pojo/src/main/java/org/eclipse/daanse/rdb/structure/pojo/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * - */ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.rdb.structure.pojo; diff --git a/structure.reader/pom.xml b/structure.reader/pom.xml deleted file mode 100644 index 970f085..0000000 --- a/structure.reader/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.rdb - ${revision} - - org.eclipse.daanse.rdb.structure.reader - - - - com.h2database - h2 - 2.2.224 - test - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.api - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rolap.mapping.emf - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.rdb.structure.emf - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.jdbc.db.api - ${project.version} - - - org.eclipse.daanse - org.eclipse.daanse.jdbc.db.core - ${project.version} - runtime - - - diff --git a/structure.reader/src/main/java/org/eclipse/daanse/rdb/structure/reader/EmfRdbProvider.java b/structure.reader/src/main/java/org/eclipse/daanse/rdb/structure/reader/EmfRdbProvider.java deleted file mode 100644 index 97818a8..0000000 --- a/structure.reader/src/main/java/org/eclipse/daanse/rdb/structure/reader/EmfRdbProvider.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.reader; - -import java.sql.JDBCType; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.OptionalInt; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Supplier; - -import javax.sql.RowSetMetaData; - -import org.eclipse.daanse.jdbc.db.api.meta.MetaInfo; -import org.eclipse.daanse.jdbc.db.api.meta.StructureInfo; -import org.eclipse.daanse.jdbc.db.api.schema.ColumnDefinition; -import org.eclipse.daanse.jdbc.db.api.schema.ImportedKey; -import org.eclipse.daanse.jdbc.db.api.schema.SchemaReference; -import org.eclipse.daanse.jdbc.db.api.schema.TableDefinition; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.Column; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.Link; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.RelationalDatabaseFactory; -import org.eclipse.daanse.rdb.structure.emf.rdbstructure.Table; - -public class EmfRdbProvider implements Supplier { - - private final StructureInfo structureInfo; - private AtomicInteger counterSchema = new AtomicInteger(); - - public EmfRdbProvider(MetaInfo metaInfo) throws SQLException { - structureInfo = metaInfo.structureInfo(); - } - - @Override - public DatabaseCatalog get() { - return getDatabaseCatalog(); - } - - private DatabaseCatalog getDatabaseCatalog() { - try { - DatabaseCatalog databaseCatalog = RelationalDatabaseFactory.eINSTANCE.createDatabaseCatalog(); - Collection schemas = getSchemas(); - Collection links = getLinks(schemas); - databaseCatalog.getSchemas().addAll(schemas); - databaseCatalog.getLinks().addAll(links); - return databaseCatalog; - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - private Collection getLinks(Collection schemas) throws SQLException { - List links = new ArrayList<>(); - for (ImportedKey importedKey : structureInfo.importedKeys()) { - if (importedKey.primaryKeyColumn() != null && importedKey.primaryKeyColumn().table() != null - && importedKey.primaryKeyColumn().table().isPresent() - && importedKey.primaryKeyColumn().table().get().schema().isPresent() - && importedKey.foreignKeyColumn() != null && importedKey.foreignKeyColumn().table() != null - && importedKey.foreignKeyColumn().table().isPresent()) { - SchemaReference schema = importedKey.primaryKeyColumn().table().get().schema().get(); - Optional oSchema = schemas.stream() - .filter(s -> s.getName().equals(schema.name())).findFirst(); - if (oSchema.isPresent()) { - final String tableNamePk = importedKey.primaryKeyColumn().table().get().name(); - final String columNamePk = importedKey.primaryKeyColumn().name(); - - final String tableNameFk = importedKey.foreignKeyColumn().table().get().name(); - final String columNameFk = importedKey.foreignKeyColumn().name(); - - Optional oPrimaryKey = getColumn(oSchema.get(), tableNamePk, columNamePk); - Optional oForeignKey = getColumn(oSchema.get(), tableNameFk, columNameFk); - - if (oPrimaryKey.isPresent() && oForeignKey.isPresent()) { - Link link = RelationalDatabaseFactory.eINSTANCE.createLink(); - link.setPrimaryKey(oPrimaryKey.get()); - link.setForeignKey(oForeignKey.get()); - links.add(link); - } - } - } - } - return links; - } - - private Optional getColumn(DatabaseSchema schema, String tableNamePk, String columNamePk) { - Optional oTable = schema.getTables().stream().filter(t -> t.getName().equals(tableNamePk)).findFirst(); - if (oTable.isPresent()) { - Table t = oTable.get(); - List columns = t.getColumns(); - if (columns != null) { - return columns.stream().filter(c -> c.getName().equals(columNamePk)).findFirst(); - } - } - return Optional.empty(); - } - - private Collection getSchemas() { - List schemas = new ArrayList<>(); - for (SchemaReference schemaReference : structureInfo.schemas()) { - String catalogName = null; - if (schemaReference.catalog().isPresent()) { - catalogName = schemaReference.catalog().get().name(); - } - final String schemaName = schemaReference.name(); - DatabaseSchema databaseSchema = RelationalDatabaseFactory.eINSTANCE.createDatabaseSchema(); - databaseSchema.setId("s_" + counterSchema.incrementAndGet()); - databaseSchema.setName(schemaName); - databaseSchema.getTables().addAll(getTables(catalogName, schemaName, databaseSchema)); - schemas.add(databaseSchema); - } - return schemas; - } - - private Collection getTables(String catalog, String schemaName, DatabaseSchema databaseSchema) { - List
tabes = new ArrayList<>(); - for (TableDefinition tableDefinition : structureInfo.tables()) { - if (tableDefinition.table().schema().isPresent() - && tableDefinition.table().schema().get().name().equals(schemaName)) { - final String tableName = tableDefinition.table().name(); - final String tableType = tableDefinition.table().type(); - if (tableType.equals("TABLE") || tableType.equals("BASE TABLE")) { - Table table = RelationalDatabaseFactory.eINSTANCE.createPhysicalTable(); - Collection columns = getColumns(catalog, schemaName, tableName, table); - table.setName(tableName); - table.getColumns().addAll(columns); - table.setSchema(databaseSchema); - table.setDescription("table " + tableName); - tabes.add(table); - } - if (tableType.equals("VIEW")) { - Table table = RelationalDatabaseFactory.eINSTANCE.createViewTable(); - Collection columns = getColumns(catalog, schemaName, tableName, table); - table.setName(tableName); - table.getColumns().addAll(columns); - table.setSchema(databaseSchema); - table.setDescription("view " + tableName); - tabes.add(table); - } - if (tableType.equals("SYSTEM TABLE")) { - Table table = RelationalDatabaseFactory.eINSTANCE.createSystemTable(); - Collection columns = getColumns(catalog, schemaName, tableName, table); - table.setName(tableName); - table.getColumns().addAll(columns); - table.setSchema(databaseSchema); - table.setDescription("system table " + tableName); - tabes.add(table); - } - } - } - - return tabes; - } - - public List getColumns(String catalog, String schema, String tableName, Table table) { - List columns = new ArrayList<>(); - for (ColumnDefinition columnDefinition : structureInfo.columns()) { - if (columnDefinition.column().table() != null && columnDefinition.column().table().isPresent() - && columnDefinition.column().table().get().name().equals(tableName) - && columnDefinition.column().table().get().schema().isPresent() - && columnDefinition.column().table().get().schema().get().name().equals(schema) - ) { - final String columName = columnDefinition.column().name(); - JDBCType jdbcType = columnDefinition.columnMetaData().dataType(); - final OptionalInt columnSize = columnDefinition.columnMetaData().columnSize(); - final OptionalInt decimalDigits = columnDefinition.columnMetaData().decimalDigits(); - final OptionalInt numPrecRadix = columnDefinition.columnMetaData().numPrecRadix(); - final OptionalInt nullable = columnDefinition.columnMetaData().nullable(); - final OptionalInt charOctetLength = columnDefinition.columnMetaData().charOctetLength(); - - Column column = RelationalDatabaseFactory.eINSTANCE.createColumn(); - column.setName(columName); - column.setType(jdbcType.getName().toLowerCase()); - column.setTable(table); - decimalDigits.ifPresent(i -> column.setDecimalDigits(i)); - columnSize.ifPresent(i -> column.setColumnSize(i)); - numPrecRadix.ifPresent(i -> column.setNumPrecRadix(i)); - charOctetLength.ifPresent(i -> column.setCharOctetLength(i)); - nullable.ifPresent(i -> column.setNullable(i == RowSetMetaData.columnNullable)); - column.setDescription(columnDefinition.columnMetaData().remarks().orElse(null)); - columns.add(column); - - } - } - return columns; - } - -} diff --git a/structure.reader/src/test/java/org/eclipse/daanse/rdb/structure/reader/EmfRdbProviderH2Test.java b/structure.reader/src/test/java/org/eclipse/daanse/rdb/structure/reader/EmfRdbProviderH2Test.java deleted file mode 100644 index 4a7904e..0000000 --- a/structure.reader/src/test/java/org/eclipse/daanse/rdb/structure/reader/EmfRdbProviderH2Test.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.rdb.structure.reader; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Optional; -import java.util.UUID; - -import javax.sql.DataSource; - -import org.eclipse.daanse.jdbc.db.api.DatabaseService; -import org.eclipse.daanse.jdbc.db.api.meta.MetaInfo; -import org.eclipse.daanse.rdb.structure.api.model.Column; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseCatalog; -import org.eclipse.daanse.rdb.structure.api.model.DatabaseSchema; -import org.eclipse.daanse.rdb.structure.api.model.Table; -import org.h2.jdbcx.JdbcDataSource; -import org.junit.jupiter.api.Test; -import org.osgi.test.common.annotation.InjectService; - -class DatabaseServiceImplH2Test { - - private String catalogName = UUID.randomUUID().toString().toUpperCase(); - - private DataSource ds() { - JdbcDataSource ds = new JdbcDataSource(); - ds.setURL("jdbc:h2:memFS:" + catalogName); - ds.setUser("sa"); - ds.setPassword("sa"); - return ds; - } - - private void setupData(Connection connection) throws SQLException { - String sql = "Create table test (ID int primary key, name varchar(50), val numeric(10,3) NOT NULL, birthday date NOT NULL, t time NOT NULL)"; - - Statement statement = connection.createStatement(); - - statement.execute(sql); - - System.out.println("Created test table."); - - sql = "Insert into test (ID, name, val, birthday, t) values (1, 'name', 13.3, '1973-01-07', '18:20:59')"; - - int rows = statement.executeUpdate(sql); - - if (rows > 0) { - System.out.println("Inserted a new row."); - } - connection.commit(); - } - - @Test - void test(@InjectService DatabaseService databaseService) throws SQLException { - DataSource ds = ds(); - try (Connection connection = ds.getConnection()) { - setupData(connection); - MetaInfo metaInfo = databaseService.createMetaInfo(ds.getConnection()); - EmfRdbProvider emfRdbProvider = new EmfRdbProvider(metaInfo); - DatabaseCatalog databaseCatalog = emfRdbProvider.get(); - assertThat(databaseCatalog).isNotNull(); - assertThat(databaseCatalog.getSchemas()).isNotNull().hasSize(2); - //PIBLIC - Optional oSchema = databaseCatalog.getSchemas().stream().filter(s -> "PUBLIC".equals(s.getName())).findAny(); - assertThat(oSchema).isNotNull().isPresent(); - DatabaseSchema schema = oSchema.get(); - assertThat(schema).isNotNull(); - assertThat(schema.getTables()).isNotNull().hasSize(1); - - Optional oTable = schema.getTables().stream().filter(t -> "TEST".equals(t.getName())).findAny(); - assertThat(oTable).isNotNull().isPresent(); - Table table = oTable.get(); - assertThat(table).isNotNull(); - assertThat(table.getColumns()).isNotNull().hasSize(5); - - Optional oColumn = table.getColumns().stream().filter(c -> "ID".equals(c.getName())).findAny(); - assertThat(oColumn).isNotNull().isPresent(); - Column column = oColumn.get(); - assertThat(column).isNotNull(); - assertThat(column.getType()).isEqualTo("integer"); - assertThat(column.getColumnSize()).isEqualTo(32); - assertThat(column.getDecimalDigits()).isEqualTo(0); - assertThat(column.getCharOctetLength()).isEqualTo(32); - assertThat(column.getNullable()).isEqualTo(false); - - oColumn = table.getColumns().stream().filter(c -> "NAME".equals(c.getName())).findAny(); - assertThat(oColumn).isNotNull().isPresent(); - column = oColumn.get(); - assertThat(column).isNotNull(); - assertThat(column.getType()).isEqualTo("varchar"); - assertThat(column.getColumnSize()).isEqualTo(50); - assertThat(column.getDecimalDigits()).isEqualTo(0); - assertThat(column.getCharOctetLength()).isEqualTo(50); - assertThat(column.getNullable()).isEqualTo(true); - - oColumn = table.getColumns().stream().filter(c -> "VAL".equals(c.getName())).findAny(); - assertThat(oColumn).isNotNull().isPresent(); - column = oColumn.get(); - assertThat(column).isNotNull(); - assertThat(column.getType()).isEqualTo("numeric"); - assertThat(column.getColumnSize()).isEqualTo(10); - assertThat(column.getDecimalDigits()).isEqualTo(3); - assertThat(column.getCharOctetLength()).isEqualTo(10); - assertThat(column.getNullable()).isEqualTo(false); - - oColumn = table.getColumns().stream().filter(c -> "BIRTHDAY".equals(c.getName())).findAny(); - assertThat(oColumn).isNotNull().isPresent(); - column = oColumn.get(); - assertThat(column).isNotNull(); - assertThat(column.getType()).isEqualTo("date"); - assertThat(column.getColumnSize()).isEqualTo(10); - assertThat(column.getDecimalDigits()).isEqualTo(0); - assertThat(column.getCharOctetLength()).isEqualTo(10); - assertThat(column.getNullable()).isEqualTo(false); - - oColumn = table.getColumns().stream().filter(c -> "T".equals(c.getName())).findAny(); - assertThat(oColumn).isNotNull().isPresent(); - column = oColumn.get(); - assertThat(column).isNotNull(); - assertThat(column.getType()).isEqualTo("time"); - assertThat(column.getColumnSize()).isEqualTo(8); - assertThat(column.getDecimalDigits()).isEqualTo(0); - assertThat(column.getCharOctetLength()).isEqualTo(8); - assertThat(column.getNullable()).isEqualTo(false); - - } - } - -} diff --git a/structure.reader/test.bndrun b/structure.reader/test.bndrun deleted file mode 100644 index 44e7334..0000000 --- a/structure.reader/test.bndrun +++ /dev/null @@ -1,87 +0,0 @@ -#******************************************************************************* -# Copyright (c) 2004 Contributors to the Eclipse Foundation -# -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# SmartCity Jena - initial -# Stefan Bischof (bipolis.org) - initial -#******************************************************************************* - --runstartlevel: \ - order=sortbynameversion,\ - begin=-1 - --runtrace: true - --tester: biz.aQute.tester.junit-platform - -# JaCoCo calculates test coverage --runpath.jacoco:\ - org.jacoco.agent,\ - org.jacoco.agent.rt - --runvm.coverage: -javaagent:${repo;org.jacoco.agent.rt}=destfile=${target-dir}/jacoco.exec - --runpath.log: \ - ch.qos.logback.classic,\ - ch.qos.logback.core,\ - slf4j.api - --runproperties.logback:\ - org.osgi.framework.bootdelegation=org.mockito.internal.creation.bytebuddy.inject,\ - logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml - --runsystemcapabilities: ${native_capability} - --resolve.effective: active - - --runfw: org.apache.felix.framework - --runee: JavaSE-21 - --runrequires: \ - bnd.identity;id='${project.artifactId}-tests',\ - bnd.identity;id='${project.artifactId}',\ - bnd.identity;id='org.eclipse.daanse.jdbc.db.api',\ - bnd.identity;id='org.eclipse.daanse.jdbc.db.core',\ - bnd.identity;id='org.eclipse.daanse.jdbc.db.record' - - -# -runbundles is calculated by the bnd-resolver-maven-plugin --runbundles: \ - assertj-core;version='[3.26.0,3.26.1)',\ - com.h2database;version='[2.2.224,2.2.225)',\ - junit-jupiter-api;version='[5.10.2,5.10.3)',\ - junit-jupiter-engine;version='[5.10.2,5.10.3)',\ - junit-jupiter-params;version='[5.10.2,5.10.3)',\ - junit-platform-commons;version='[1.10.2,1.10.3)',\ - junit-platform-engine;version='[1.10.2,1.10.3)',\ - junit-platform-launcher;version='[1.10.2,1.10.3)',\ - net.bytebuddy.byte-buddy;version='[1.14.16,1.14.17)',\ - org.apache.felix.configadmin;version='[1.9.26,1.9.27)',\ - org.apache.felix.scr;version='[2.2.10,2.2.11)',\ - org.eclipse.daanse.jdbc.db.api;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.jdbc.db.core;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.jdbc.db.record;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.rdb.structure.api;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.rdb.structure.emf;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.rdb.structure.reader;version='[0.0.1,0.0.2)',\ - org.eclipse.daanse.rdb.structure.reader-tests;version='[0.0.1,0.0.2)',\ - org.eclipse.emf.common;version='[2.30.0,2.30.1)',\ - org.eclipse.emf.ecore;version='[2.36.0,2.36.1)',\ - org.eclipse.emf.ecore.xmi;version='[2.37.0,2.37.1)',\ - org.gecko.emf.osgi.api;version='[6.1.3,6.1.4)',\ - org.gecko.emf.osgi.component;version='[6.1.3,6.1.4)',\ - org.opentest4j;version='[1.3.0,1.3.1)',\ - org.osgi.service.component;version='[1.5.1,1.5.2)',\ - org.osgi.test.common;version='[1.3.0,1.3.1)',\ - org.osgi.test.junit5;version='[1.3.0,1.3.1)',\ - org.osgi.util.converter;version='[1.0.9,1.0.10)',\ - org.osgi.util.function;version='[1.2.0,1.2.1)',\ - org.osgi.util.promise;version='[1.3.0,1.3.1)' \ No newline at end of file