use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapIsNotIn.
// DATAJDBC-318
@Test
public void shouldMapIsNotIn() {
Criteria criteria = Criteria.where("name").notIn("a", "b", "c");
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" NOT IN (?[:name], ?[:name1], ?[:name2])");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapSimpleCriteria.
// DATAJDBC-318
@Test
public void shouldMapSimpleCriteria() {
Criteria criteria = Criteria.where("name").is("foo");
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" = ?[:name]");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapIsLte.
// DATAJDBC-318
@Test
public void shouldMapIsLte() {
Criteria criteria = Criteria.where("name").lessThanOrEquals("a");
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" <= ?[:name]");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapOrCriteria.
// DATAJDBC-318
@Test
public void shouldMapOrCriteria() {
Criteria criteria = Criteria.where("name").is("foo").or("bar").is("baz");
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" = ?[:name] OR person.bar = ?[:bar]");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldNotMapEmptyCriteria.
// DATAJDBC-318
@Test
public void shouldNotMapEmptyCriteria() {
Criteria criteria = Criteria.empty();
assertThatIllegalArgumentException().isThrownBy(() -> map(criteria));
}
Aggregations