use of org.springframework.data.relational.repository.query.RelationalParametersParameterAccessor in project spring-data-jdbc by spring-projects.
the class PartTreeJdbcQueryUnitTests method createsQueryToFindAllEntitiesByStringAttributeIgnoringCase.
// DATAJDBC-318
@Test
public void createsQueryToFindAllEntitiesByStringAttributeIgnoringCase() throws Exception {
JdbcQueryMethod queryMethod = getQueryMethod("findAllByFirstNameIgnoreCase", String.class);
PartTreeJdbcQuery jdbcQuery = createQuery(queryMethod);
RelationalParametersParameterAccessor accessor = getAccessor(queryMethod, new Object[] { "John" });
ParametrizedQuery query = jdbcQuery.createQuery(accessor, returnedType);
assertThat(query.getQuery()).isEqualTo(BASE_SELECT + " WHERE UPPER(" + TABLE + ".\"FIRST_NAME\") = UPPER(:first_name)");
}
use of org.springframework.data.relational.repository.query.RelationalParametersParameterAccessor in project spring-data-jdbc by spring-projects.
the class PartTreeJdbcQueryUnitTests method createsQueryToFindAllEntitiesByStringAttributeContaining.
// DATAJDBC-318
@Test
public void createsQueryToFindAllEntitiesByStringAttributeContaining() throws Exception {
JdbcQueryMethod queryMethod = getQueryMethod("findAllByFirstNameContaining", String.class);
PartTreeJdbcQuery jdbcQuery = createQuery(queryMethod);
RelationalParametersParameterAccessor accessor = getAccessor(queryMethod, new Object[] { "oh" });
ParametrizedQuery query = jdbcQuery.createQuery(accessor, returnedType);
assertThat(query.getQuery()).isEqualTo(BASE_SELECT + " WHERE " + TABLE + ".\"FIRST_NAME\" LIKE :first_name");
}
use of org.springframework.data.relational.repository.query.RelationalParametersParameterAccessor in project spring-data-jdbc by spring-projects.
the class PartTreeJdbcQueryUnitTests method createsQueryToFindAllEntitiesByIntegerAttributeIsNotNull.
// DATAJDBC-318
@Test
public void createsQueryToFindAllEntitiesByIntegerAttributeIsNotNull() throws Exception {
JdbcQueryMethod queryMethod = getQueryMethod("findAllByAgeIsNotNull");
PartTreeJdbcQuery jdbcQuery = createQuery(queryMethod);
RelationalParametersParameterAccessor accessor = getAccessor(queryMethod, new Object[0]);
ParametrizedQuery query = jdbcQuery.createQuery(accessor, returnedType);
assertThat(query.getQuery()).isEqualTo(BASE_SELECT + " WHERE " + TABLE + ".\"AGE\" IS NOT NULL");
}
Aggregations