use of org.springframework.data.relational.core.sql.Condition in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapSimpleCriteriaWithoutEntity.
// DATAJDBC-318
@Test
public void shouldMapSimpleCriteriaWithoutEntity() {
Criteria criteria = Criteria.where("name").is("foo");
Condition condition = mapper.getMappedObject(new MapSqlParameterSource(), criteria, Table.create("person"), null);
assertThat(condition).hasToString("person.name = ?[:name]");
}
use of org.springframework.data.relational.core.sql.Condition in project spring-data-jdbc by spring-projects.
the class QueryMapperUnitTests method shouldMapIsNotNull.
// DATAJDBC-318
@Test
public void shouldMapIsNotNull() {
Criteria criteria = Criteria.where("name").isNotNull();
Condition condition = map(criteria);
assertThat(condition).hasToString("person.\"NAME\" IS NOT NULL");
}
use of org.springframework.data.relational.core.sql.Condition 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.sql.Condition 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.sql.Condition 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]");
}
Aggregations