use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapSimpleNullableCriteria.
// DATAJDBC-318
@Test
public void shouldMapSimpleNullableCriteria() {
Criteria criteria = Criteria.where("name").isNull();
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" IS NULL");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapAndOrCriteria.
// DATAJDBC-318
@Test
public void shouldMapAndOrCriteria() {
Criteria criteria = //
Criteria.where("name").is("foo").and("name").isNotNull().or("bar").is(//
"baz").and("anotherOne").is("alternative");
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" = ?[:name] AND person.\"NAME\" IS NOT NULL OR person.bar = ?[:bar] AND person.anotherOne = ?[:anotherOne]");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapIsNull.
// DATAJDBC-318
@Test
public void shouldMapIsNull() {
Criteria criteria = Criteria.where("name").isNull();
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" IS NULL");
}
use of org.springframework.data.relational.core.query.Criteria in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapIsLt.
// DATAJDBC-318
@Test
public void shouldMapIsLt() {
Criteria criteria = Criteria.where("name").lessThan("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 shouldMapAndCriteria.
// DATAJDBC-318
@Test
public void shouldMapAndCriteria() {
Criteria criteria = Criteria.where("name").is("foo").and("bar").is("baz");
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" = ?[:name] AND person.bar = ?[:bar]");
}
Aggregations