Manuel Núñez created IGNITE-13005:
-------------------------------------
Summary: Spring Data 2 - JPA Improvements and working with
multiple Ignite instances on same JVM
Key: IGNITE-13005
URL: https://issues.apache.org/jira/browse/IGNITE-13005
Project: Ignite
Issue Type: Improvement
Components: spring
Affects Versions: 2.7.6
Reporter: Manuel Núñez
Assignee: Ilya Kasnacheev
I have it working for Spring Data 2 (2.7.6) module with some interesting
improvements, but by now I don't have enough time to give it the attention it
requires, full unit/integration tests..., sorry a lot. ¿maybe any of you have
the time?. Thanks community!!
Code is 100% compatible with previous versions.
[https://github.com/hawkore/ignite-hk/tree/master/modules/spring-data-2.0]
* Supports multiple ignite instances on same JVM (@RepositoryConfig).
* Supports query tuning parameters in {{@Query}} annotation
* Supports projections
* Supports {{Page}} and {{Stream}} responses
* Supports Sql Fields Query resultset transformation into the domain entity
* Supports named parameters ({{:myParam}}) into SQL queries, declared using
{{@Param("myParam")}}
* Supports advanced parameter binding and SpEL expressions into SQL queries:
** *Template variables*:
*** {{#entityName}} - the simple class name of the domain entity
** *Method parameter expressions*: Parameters are exposed for indexed access
({{[0]}} is the first query method's param) or via the name declared using
{{@Param}}. The actual SpEL expression binding is triggered by {{?#}}. Example:
{{?#{[0]}}} or {{?#{#myParamName}}}
** *Advanced SpEL expressions*: While advanced parameter binding is a very
useful feature, the real power of SpEL stems from the fact, that the
expressions can refer to framework abstractions or other application components
through SpEL EvaluationContext extension model.
* Supports SpEL expressions into Text queries ({{TextQuery}}). Examples:
{code:java}
@Query(value = "SELECT * from #{#entityName} where email = :email")
User searchUserByEmail(@Param("email") String email);
@Query(value = "SELECT * from #{#entityName} where country = ?#{[0] and city =
?#{[1]}")
List<User> searchUsersByCity(@Param("country") String country, @Param("city")
String city, Pageable pageable);
@Query(value = "SELECT * from #{#entityName} where email = ?")
User searchUserByEmail(String email);
@Query(value = "SELECT * from #{#entityName} where uuidCity = ?#{
mySpELFunctionsBean.cityNameToUUID(#city)}")
List<User> searchUsersByCity(@Param("city") String city, Pageable pageable);
@Query(textQuery = true, value = "email: #{#email}")
User searchUserByEmail(@Param("email") String email);
@Query(textQuery = true, value = "#{#textToSearch}")
List<User> searchUsersByText(@Param("textToSearch") String text, Pageable
pageable);
@Query(textQuery = true, value = "#{[0]}")
List<User> searchUsersByText(String textToSearch, Pageable pageable);
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)