use of org.springframework.data.relational.core.sql.Select in project spring-data-jdbc by spring-projects.
the class MySqlDialectRenderingUnitTests method shouldRenderSelectWithLockWrite.
// DATAJDBC-498
@Test
public void shouldRenderSelectWithLockWrite() {
Table table = Table.create("foo");
LockMode lockMode = LockMode.PESSIMISTIC_WRITE;
Select select = StatementBuilder.select(table.asterisk()).from(table).lock(lockMode).build();
String sql = SqlRenderer.create(factory.createRenderContext()).render(select);
assertThat(sql).isEqualTo("SELECT foo.* FROM foo FOR UPDATE");
}
Aggregations