use of org.obeonetwork.dsl.database.DataBase in project InformationSystem by ObeoNetwork.
the class DatabaseImportHelper method addFileToResolver.
private static void addFileToResolver(MultiDataBaseQueries queries, IFile referencedFile) {
URI uri = URI.createPlatformResourceURI(referencedFile.getFullPath().toString(), true);
ResourceSet set = new ResourceSetImpl();
Resource resource = set.getResource(uri, true);
for (EObject root : resource.getContents()) {
if (root instanceof DataBase) {
queries.registerDatabase((DataBase) root);
}
}
}
use of org.obeonetwork.dsl.database.DataBase in project InformationSystem by ObeoNetwork.
the class GenerateSQLFromDatabaseHandler method copyDatabase.
private DataBase copyDatabase(DataBase database) {
DataBase newDatabase = DatabaseFactory.eINSTANCE.createDataBase();
newDatabase.setName(database.getName());
for (Schema schema : database.getSchemas()) {
newDatabase.getSchemas().add((Schema) copySchema(schema));
}
return newDatabase;
}
use of org.obeonetwork.dsl.database.DataBase in project InformationSystem by ObeoNetwork.
the class CreationUtils method createDatabase.
public static DataBase createDatabase(String name) {
DataBase database = DatabaseFactory.eINSTANCE.createDataBase();
database.setName(name);
return database;
}
use of org.obeonetwork.dsl.database.DataBase in project InformationSystem by ObeoNetwork.
the class TestReverse method testOracle.
@Test
public void testOracle() {
DataSource dataSource = new DataSource("XE", "NORTHWIND");
dataSource.setJdbcUrl("jdbc:oracle:thin:northwind/northwind@//localhost:1521/XE");
dataSource.setJdbcUsername("northwind");
dataSource.setJdbcPassword("northwind");
dataSource.setVendor("Oracle-11g");
DataBase database = DatabaseReverser.reverse(dataSource, new MultiDataBaseQueries(), null);
DataBase databaseRef = loadModel("resources/oracle/outputRef.database", "pathmap://NativeDBTypes/Oracle-11g");
checkEquality(database, databaseRef);
}
use of org.obeonetwork.dsl.database.DataBase in project InformationSystem by ObeoNetwork.
the class TestReverse method testH2Server.
@Test
public void testH2Server() {
String databaseLocation = getH2DatabaseLocation(this.getClass(), "input");
DataSource dataSource = new DataSource("appli1", "PUBLIC");
dataSource.setJdbcUrl("jdbc:h2:tcp://localhost/" + databaseLocation);
dataSource.setJdbcUsername("sa");
dataSource.setVendor("H2-1.3");
DataBase database = DatabaseReverser.reverse(dataSource, new MultiDataBaseQueries(), null);
DataBase databaseRef = loadModel("resources/h2/outputRef.database", "pathmap://NativeDBTypes/H2-1.3");
checkEquality(database, databaseRef);
}
Aggregations