Set active profile on HSQL specific tests to HSQL.
Fixed Readme to properly reflect the need to have a Docker installation.
Original pull request: #59.
RowMapper can be configured either via the @Query(rowMapperClass = ….) or by registerign a RowMapperMap bean and register RowMapper per method return type.
@Bean
RowMapperMap rowMappers() {
return new ConfigurableRowMapperMap() //
.register(Person.class, new PersonRowMapper()) //
.register(Address.class, new AddressRowMapper());
}
When determining the RowMapper to use for a method the following steps are followed based on the return type of the method:
1. If the type is a simple type no RowMapper is used. Instead the query is expected to return a single row with a single column and a conversion to the return type is applied to that value.
2. The entity classes in the RowMapperMap are iterated until one is found that is a superclass or interface of the return type in question. The RowMapper registered for that class is used. Iterating happens in the order of registration, so make sure to register more general types after specific ones.
If applicable wrapper type like collections or Optional are unwrapped. So a return type of Optional<Person> will use the type Person in the steps above.
If MyBatis-spring is available and a SqlSessionFactory in the Application Context we look for matching mapped sql statements instead of using the default generated SQL.
Introduced DataAccessStrategy as a new abstraction level, operating on a single entity. JdbcEntityOperations only contain operations related to complete Aggregates. Thereby also solving DATAJDBC-132.
Integration tests ending in HsqlIntegrationTest will only get executed using HsqlDb.
Related issue: DATAJDBC-132.