use of com.cadenzauk.siesta.dialect.AnsiDialect in project siesta by cadenzauk.
the class SelectExpressionTest method isNotNull.
@Test
void isNotNull() {
Database database = testDatabase(new AnsiDialect());
String sql = database.from(WidgetRow.class).where(WidgetRow::manufacturerId).isNotNull().sql();
assertThat(sql, is("select WIDGET.WIDGET_ID as WIDGET_WIDGET_ID, " + "WIDGET.NAME as WIDGET_NAME, " + "WIDGET.MANUFACTURER_ID as WIDGET_MANUFACTURER_ID, " + "WIDGET.DESCRIPTION as WIDGET_DESCRIPTION " + "from SIESTA.WIDGET WIDGET " + "where WIDGET.MANUFACTURER_ID is not null"));
}
use of com.cadenzauk.siesta.dialect.AnsiDialect in project siesta by cadenzauk.
the class SelectExpressionTest method isNull.
@Test
void isNull() {
Database database = testDatabase(new AnsiDialect());
String sql = database.from(WidgetRow.class).where(WidgetRow::description).isNull().sql();
assertThat(sql, is("select WIDGET.WIDGET_ID as WIDGET_WIDGET_ID, " + "WIDGET.NAME as WIDGET_NAME, " + "WIDGET.MANUFACTURER_ID as WIDGET_MANUFACTURER_ID, " + "WIDGET.DESCRIPTION as WIDGET_DESCRIPTION " + "from SIESTA.WIDGET WIDGET " + "where WIDGET.DESCRIPTION is null"));
}
use of com.cadenzauk.siesta.dialect.AnsiDialect in project siesta by cadenzauk.
the class SelectExpressionTest method isNotIn.
@Test
void isNotIn() {
Database database = testDatabase(new AnsiDialect());
String sql = database.from(WidgetRow.class).where(WidgetRow::widgetId).isNotIn(123L, 456L, 789L).sql();
assertThat(sql, is("select WIDGET.WIDGET_ID as WIDGET_WIDGET_ID, " + "WIDGET.NAME as WIDGET_NAME, " + "WIDGET.MANUFACTURER_ID as WIDGET_MANUFACTURER_ID, " + "WIDGET.DESCRIPTION as WIDGET_DESCRIPTION " + "from SIESTA.WIDGET WIDGET " + "where WIDGET.WIDGET_ID not in (?, ?, ?)"));
}
use of com.cadenzauk.siesta.dialect.AnsiDialect in project siesta by cadenzauk.
the class SelectExpressionTest method isNotLikeEscape.
@Test
void isNotLikeEscape() {
Database database = testDatabase(new AnsiDialect());
String sql = database.from(WidgetRow.class).where(WidgetRow::name).isNotLike("abc+%%", "+").sql();
assertThat(sql, is("select WIDGET.WIDGET_ID as WIDGET_WIDGET_ID, " + "WIDGET.NAME as WIDGET_NAME, " + "WIDGET.MANUFACTURER_ID as WIDGET_MANUFACTURER_ID, " + "WIDGET.DESCRIPTION as WIDGET_DESCRIPTION " + "from SIESTA.WIDGET WIDGET " + "where WIDGET.NAME not like ? escape '+'"));
}
use of com.cadenzauk.siesta.dialect.AnsiDialect in project siesta by cadenzauk.
the class SelectExpressionTest method isLike.
@Test
void isLike() {
Database database = testDatabase(new AnsiDialect());
String sql = database.from(WidgetRow.class).where(WidgetRow::name).isLike("abc%").sql();
assertThat(sql, is("select WIDGET.WIDGET_ID as WIDGET_WIDGET_ID, " + "WIDGET.NAME as WIDGET_NAME, " + "WIDGET.MANUFACTURER_ID as WIDGET_MANUFACTURER_ID, " + "WIDGET.DESCRIPTION as WIDGET_DESCRIPTION " + "from SIESTA.WIDGET WIDGET " + "where WIDGET.NAME like ?"));
}
Aggregations