use of org.seasar.doma.jdbc.JdbcException in project doma by domaframework.
the class StandardDialectTest method testTransformSelectSqlNode_forUpdateNowait_alias.
@Test
public void testTransformSelectSqlNode_forUpdateNowait_alias() {
StandardDialect dialect = new StandardDialectStab();
SqlParser parser = new SqlParser("select * from emp order by emp.id");
SqlNode sqlNode = parser.parse();
SelectOptions options = SelectOptions.get().forUpdateNowait("emp");
try {
dialect.transformSelectSqlNode(sqlNode, options);
fail();
} catch (JdbcException ex) {
System.out.println(ex.getMessage());
assertEquals("DOMA2082", ex.getMessageResource().getCode());
}
}
use of org.seasar.doma.jdbc.JdbcException in project doma by domaframework.
the class StandardDialectTest method testTransformSelectSqlNode_forUpdate.
@Test
public void testTransformSelectSqlNode_forUpdate() {
StandardDialect dialect = new StandardDialect();
SqlParser parser = new SqlParser("select * from emp order by emp.id");
SqlNode sqlNode = parser.parse();
SelectOptions options = SelectOptions.get().forUpdate();
try {
dialect.transformSelectSqlNode(sqlNode, options);
fail();
} catch (JdbcException ex) {
System.out.println(ex.getMessage());
assertEquals("DOMA2023", ex.getMessageResource().getCode());
}
}
use of org.seasar.doma.jdbc.JdbcException in project doma by domaframework.
the class StandardDialectTest method testTransformSelectSqlNode_forUpdateWait.
@Test
public void testTransformSelectSqlNode_forUpdateWait() {
StandardDialect dialect = new StandardDialect();
SqlParser parser = new SqlParser("select * from emp order by emp.id");
SqlNode sqlNode = parser.parse();
SelectOptions options = SelectOptions.get().forUpdateWait(1);
try {
dialect.transformSelectSqlNode(sqlNode, options);
fail();
} catch (JdbcException ex) {
System.out.println(ex.getMessage());
assertEquals("DOMA2079", ex.getMessageResource().getCode());
}
}
use of org.seasar.doma.jdbc.JdbcException in project doma by domaframework.
the class StandardDialectTest method testTransformSelectSqlNode_forUpdateNowait.
@Test
public void testTransformSelectSqlNode_forUpdateNowait() {
StandardDialect dialect = new StandardDialect();
SqlParser parser = new SqlParser("select * from emp order by emp.id");
SqlNode sqlNode = parser.parse();
SelectOptions options = SelectOptions.get().forUpdateNowait();
try {
dialect.transformSelectSqlNode(sqlNode, options);
fail();
} catch (JdbcException ex) {
System.out.println(ex.getMessage());
assertEquals("DOMA2080", ex.getMessageResource().getCode());
}
}
use of org.seasar.doma.jdbc.JdbcException in project doma by domaframework.
the class AutoBatchUpdateTest method testNoId.
@Test
public void testNoId(Config config) throws Exception {
NoIdDao dao = new NoIdDaoImpl(config);
NoId entity = new NoId();
entity.setValue1(1);
entity.setValue2(2);
NoId entity2 = new NoId();
entity2.setValue1(1);
entity2.setValue2(2);
try {
dao.update(Arrays.asList(entity, entity2));
fail();
} catch (JdbcException expected) {
assertEquals(Message.DOMA2022, expected.getMessageResource());
}
}
Aggregations