use of org.seasar.doma.jdbc.SelectOptions in project doma-spring-boot by domaframework.
the class PageablesTest method testToSelectOptions.
@Test
public void testToSelectOptions() throws Exception {
SelectOptions options = Pageables.toSelectOptions(pageRequest(0, 10));
assertThat(SelectOptionsAccessor.getOffset(options), is(0L));
assertThat(SelectOptionsAccessor.getLimit(options), is(10L));
}
use of org.seasar.doma.jdbc.SelectOptions in project doma-spring-boot by domaframework.
the class PageablesTest method testToSelectOptions2.
@Test
public void testToSelectOptions2() throws Exception {
SelectOptions options = Pageables.toSelectOptions(pageRequest(2, 10));
assertThat(SelectOptionsAccessor.getOffset(options), is(20L));
assertThat(SelectOptionsAccessor.getLimit(options), is(10L));
}
use of org.seasar.doma.jdbc.SelectOptions in project doma by domaframework.
the class StandardDialectTest method testTransformSelectSqlNode_forUpdate_alias.
@Test
public void testTransformSelectSqlNode_forUpdate_alias() {
StandardDialect dialect = new StandardDialectStab();
SqlParser parser = new SqlParser("select * from emp order by emp.id");
SqlNode sqlNode = parser.parse();
SelectOptions options = SelectOptions.get().forUpdate("emp");
try {
dialect.transformSelectSqlNode(sqlNode, options);
fail();
} catch (JdbcException ex) {
System.out.println(ex.getMessage());
assertEquals("DOMA2024", ex.getMessageResource().getCode());
}
}
use of org.seasar.doma.jdbc.SelectOptions 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.SelectOptions 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());
}
}
Aggregations