Search in sources :

Example 1 with SchemaAndTable

use of com.querydsl.sql.SchemaAndTable in project querydsl by querydsl.

the class RenameMappingTest method schemaTableToSchemaTable.

@Test
public void schemaTableToSchemaTable() {
    mapping.setFromSchema("ABC");
    mapping.setFromTable("TABLE1");
    mapping.setToSchema("ABC");
    mapping.setToTable("TABLE2");
    mapping.apply(configuration);
    assertEquals(new SchemaAndTable("ABC", "TABLE2"), configuration.getOverride(new SchemaAndTable("ABC", "TABLE1")));
    assertEquals(new SchemaAndTable("DEF", "TABLE1"), configuration.getOverride(new SchemaAndTable("DEF", "TABLE1")));
}
Also used : SchemaAndTable(com.querydsl.sql.SchemaAndTable) Test(org.junit.Test)

Example 2 with SchemaAndTable

use of com.querydsl.sql.SchemaAndTable in project querydsl by querydsl.

the class RenameMappingTest method schemaToSchema.

// to schema
@Test
public void schemaToSchema() {
    mapping.setFromSchema("ABC");
    mapping.setToSchema("DEF");
    mapping.apply(configuration);
    assertEquals(new SchemaAndTable("DEF", "TABLE"), configuration.getOverride(new SchemaAndTable("ABC", "TABLE")));
    assertEquals(new SchemaAndTable("ABCD", "TABLE"), configuration.getOverride(new SchemaAndTable("ABCD", "TABLE")));
}
Also used : SchemaAndTable(com.querydsl.sql.SchemaAndTable) Test(org.junit.Test)

Example 3 with SchemaAndTable

use of com.querydsl.sql.SchemaAndTable in project querydsl by querydsl.

the class RenameMappingTest method schemaTableToTable.

@Test
public void schemaTableToTable() {
    mapping.setFromSchema("ABC");
    mapping.setFromTable("TABLE1");
    mapping.setToTable("TABLE2");
    mapping.apply(configuration);
    assertEquals(new SchemaAndTable("ABC", "TABLE2"), configuration.getOverride(new SchemaAndTable("ABC", "TABLE1")));
    assertEquals(new SchemaAndTable("DEF", "TABLE1"), configuration.getOverride(new SchemaAndTable("DEF", "TABLE1")));
}
Also used : SchemaAndTable(com.querydsl.sql.SchemaAndTable) Test(org.junit.Test)

Example 4 with SchemaAndTable

use of com.querydsl.sql.SchemaAndTable in project querydsl by querydsl.

the class RenameMappingTest method tableToTable.

// to table
@Test
public void tableToTable() {
    mapping.setFromTable("TABLE1");
    mapping.setToTable("TABLE2");
    mapping.apply(configuration);
    assertEquals(new SchemaAndTable("DEF", "TABLE2"), configuration.getOverride(new SchemaAndTable("DEF", "TABLE1")));
    assertEquals(new SchemaAndTable("DEF", "TABLE3"), configuration.getOverride(new SchemaAndTable("DEF", "TABLE3")));
}
Also used : SchemaAndTable(com.querydsl.sql.SchemaAndTable) Test(org.junit.Test)

Example 5 with SchemaAndTable

use of com.querydsl.sql.SchemaAndTable in project querydsl by querydsl.

the class KeyDataFactory method createType.

private Type createType(@Nullable String schemaName, String table) {
    SchemaAndTable schemaAndTable = new SchemaAndTable(schemaName, table);
    String packageName = this.packageName;
    if (schemaToPackage) {
        packageName = namingStrategy.getPackage(packageName, schemaAndTable);
    }
    String simpleName = prefix + namingStrategy.getClassName(schemaAndTable) + suffix;
    return new SimpleType(packageName + "." + simpleName, packageName, simpleName);
}
Also used : SchemaAndTable(com.querydsl.sql.SchemaAndTable) SimpleType(com.mysema.codegen.model.SimpleType)

Aggregations

SchemaAndTable (com.querydsl.sql.SchemaAndTable)5 Test (org.junit.Test)4 SimpleType (com.mysema.codegen.model.SimpleType)1