use of org.seasar.doma.jdbc.dialect.Mssql2008Dialect in project doma by domaframework.
the class NativeSqlSelectTest method expression_concat_mssql2008.
@Test
void expression_concat_mssql2008() {
NativeSql nativeSql = new NativeSql(new MockConfig() {
@Override
public Dialect getDialect() {
return new Mssql2008Dialect();
}
});
Emp_ e = new Emp_();
Buildable<?> stmt = nativeSql.from(e).select(concat(e.name, "a"));
Sql<?> sql = stmt.asSql();
assertEquals("select (t0_.NAME + 'a') from EMP t0_", sql.getFormattedSql());
}
use of org.seasar.doma.jdbc.dialect.Mssql2008Dialect in project doma by domaframework.
the class ScriptReaderTest method setUp.
@BeforeEach
public void setUp() {
MockConfig config = new MockConfig();
config.dialect = new Mssql2008Dialect();
query = new SqlFileScriptQuery() {
@Override
public void prepare() {
}
};
query.setConfig(config);
query.setCallerClassName("aaa");
query.setCallerMethodName("bbb");
query.setBlockDelimiter(config.dialect.getScriptBlockDelimiter());
query.prepare();
}
use of org.seasar.doma.jdbc.dialect.Mssql2008Dialect in project doma by domaframework.
the class SqlFileScriptQueryTest method testPrepare_dbmsSpecific.
@Test
public void testPrepare_dbmsSpecific() {
config.dialect = new Mssql2008Dialect();
SqlFileScriptQuery query = new SqlFileScriptQuery();
query.setConfig(config);
query.setMethod(method);
query.setCallerClassName("aaa");
query.setCallerMethodName("bbb");
query.setScriptFilePath("META-INF/org/seasar/doma/jdbc/query/SqlFileScriptQueryTest/testPrepare_dbmsSpecific.script");
query.setBlockDelimiter("");
query.prepare();
assertEquals(config, query.getConfig());
assertEquals("aaa", query.getClassName());
assertEquals("bbb", query.getMethodName());
assertEquals("META-INF/org/seasar/doma/jdbc/query/SqlFileScriptQueryTest/testPrepare_dbmsSpecific-mssql.script", query.getScriptFilePath());
assertNotNull(query.getScriptFileUrl());
assertEquals("GO", query.getBlockDelimiter());
}
Aggregations