[jira] [Commented] (IGNITE-13005) Spring Data 2 - "JPA style" and working with multiple Ignite instances on same JVM
[ https://issues.apache.org/jira/browse/IGNITE-13005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148638#comment-17148638 ] Ignite TC Bot commented on IGNITE-13005: {panel:title=Branch: [pull/7953/head] Base: [master] : Possible Blockers (1)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1} {color:#d04437}[Javadoc]{color} [[tests 0 BuildFailureOnMessage |https://ci.ignite.apache.org/viewLog.html?buildId=5429379]] {panel} {panel:title=Branch: [pull/7953/head] Base: [master] : New Tests (40)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1} {color:#8b}Service Grid{color} [tests 4] * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple [val1=DiscoveryEvent [evtNode=c445da3a-8244-4fbf-9186-3b4764875704, topVer=0, nodeId8=72d54c25, msg=, type=NODE_JOINED, tstamp=1593510964131], val2=AffinityTopologyVersion [topVer=1510705476752092510, minorTopVer=0]]] - PASSED{color} * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple [val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest [id=dbce1b40371-0a49957f-5490-4ebf-a115-113aec46a950, reqs=SingletonList [ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent [evtNode=c1e7260b-ee31-4ad0-9e81-49e1f73f6352, topVer=0, nodeId8=c1e7260b, msg=null, type=DISCOVERY_CUSTOM_EVT, tstamp=1593510964131]], val2=AffinityTopologyVersion [topVer=-8014184632670024084, minorTopVer=0]]] - PASSED{color} * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple [val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest [id=dbce1b40371-0a49957f-5490-4ebf-a115-113aec46a950, reqs=SingletonList [ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent [evtNode=c1e7260b-ee31-4ad0-9e81-49e1f73f6352, topVer=0, nodeId8=c1e7260b, msg=null, type=DISCOVERY_CUSTOM_EVT, tstamp=1593510964131]], val2=AffinityTopologyVersion [topVer=-8014184632670024084, minorTopVer=0]]] - PASSED{color} * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple [val1=DiscoveryEvent [evtNode=c445da3a-8244-4fbf-9186-3b4764875704, topVer=0, nodeId8=72d54c25, msg=, type=NODE_JOINED, tstamp=1593510964131], val2=AffinityTopologyVersion [topVer=1510705476752092510, minorTopVer=0]]] - PASSED{color} {color:#8b}Service Grid (legacy mode){color} [tests 4] * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple [val1=DiscoveryEvent [evtNode=a6911711-fbfb-4be9-adf8-ef6fefbee40f, topVer=0, nodeId8=0950ddc5, msg=, type=NODE_JOINED, tstamp=1593510952640], val2=AffinityTopologyVersion [topVer=-3553699451018057005, minorTopVer=0]]] - PASSED{color} * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple [val1=DiscoveryEvent [evtNode=a6911711-fbfb-4be9-adf8-ef6fefbee40f, topVer=0, nodeId8=0950ddc5, msg=, type=NODE_JOINED, tstamp=1593510952640], val2=AffinityTopologyVersion [topVer=-3553699451018057005, minorTopVer=0]]] - PASSED{color} * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple [val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest [id=0fc81b40371-35487610-cab8-4b97-ba20-7cead8a07eaa, reqs=SingletonList [ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent [evtNode=5b03295a-19bb-40f8-b02f-198ae6b7b19c, topVer=0, nodeId8=5b03295a, msg=null, type=DISCOVERY_CUSTOM_EVT, tstamp=1593510952640]], val2=AffinityTopologyVersion [topVer=2725426480401865449, minorTopVer=0]]] - PASSED{color} * {color:#013220}IgniteServiceGridTestSuite: ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple [val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest [id=0fc81b40371-35487610-cab8-4b97-ba20-7cead8a07eaa, reqs=SingletonList [ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent [evtNode=5b03295a-19bb-40f8-b02f-198ae6b7b19c, topVer=0, nodeId8=5b03295a, msg=null, type=DISCOVERY_CUSTOM_EVT, tstamp=1593510952640]], val2=AffinityTopologyVersion [topVer=2725426480401865449, minorTopVer=0]]] - PASSED{color} {color:#8b}Spring (Data){color} [tests 32] * {color:#013220}IgniteSpringData22TestSuite: IgniteSpringDataCrudSelfTest.testUpdateQueryMixedCaseProjectionIndexedParameter - PASSED{color} * {color:#013220}IgniteSpringData22TestSuite: IgniteSpringDataCrudSelfTest.testUpdateQueryOneMixedCaseDynamicProjectionNamedParameter - PASSED{color} * {color:#013220}IgniteSpringData22TestSuite: IgniteSpringDataCrudSelfTest.testUpdateQueryMixedCaseDynamicProjectionNamedParameter - PASSED{color} * {color:#013220}IgniteSpringData22TestSuite: IgniteSpringDataC
[jira] [Commented] (IGNITE-13005) Spring Data 2 - "JPA style" and working with multiple Ignite instances on same JVM
[ https://issues.apache.org/jira/browse/IGNITE-13005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148053#comment-17148053 ] Manuel Núñez commented on IGNITE-13005: --- [~ilyak] and sorry for the delay ... too many things on the tray > Spring Data 2 - "JPA style" 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, 2.8.1 >Reporter: Manuel Núñez >Assignee: Manuel Núñez >Priority: Major > Labels: spring-data > Time Spent: 10m > Remaining Estimate: 0h > > I have it working for Spring Data 2 (2.7.6, 2.8.1) module with some > interesting improvements. > 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}}). > Some examples: > {code:java} > // Spring Data Repositories using different ignite instances on same JVM > @RepositoryConfig(igniteInstance = "FLIGHTS_BBDD", cacheName = "ROUTES") > public interface FlightRouteRepository extends IgniteRepository String> { > ... > } > @RepositoryConfig(igniteInstance = "GEO_BBDD", cacheName = "POIS") > public interface PoiRepository extends IgniteRepository { > ... > } > {code} > {code:java} > // named parameter > @Query(value = "SELECT * from #{#entityName} where email = :email") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // indexed parameters > @Query(value = "SELECT * from #{#entityName} where country = ?#{[0] and city > = ?#{[1]}") > List searchUsersByCity(@Param("country") String country, @Param("city") > String city, Pageable pageable); > {code} > {code:java} > // ordered method parameters > @Query(value = "SELECT * from #{#entityName} where email = ?") > User searchUserByEmail(String email); > {code} > {code:java} > // Advanced SpEL expressions > @Query(value = "SELECT * from #{#entityName} where uuidCity = > ?#{mySpELFunctionsBean.cityNameToUUID(#city)}") > List searchUsersByCity(@Param("city") String city, Pageable pageable); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "email: #{#email}") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "#{#textToSearch}") > List searchUsersByText(@Param("textToSearch") String text, Pageable > pageable); > {code} > {code:java} > // textQuery - evaluated SpEL indexed parameter > @Query(textQuery = true, value = "#{[0]}") > List searchUsersByText(String textToSearch, Pageable pageable); > {code} > {code:java} > // Static Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.id, m.name, m.logos ORDER BY m.name") > List searchMerchantsByOrigin(@Param("origin") String origin, > @Param("disabled") boolean disabled); > {code} > {code:java} > // Dynamic Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP
[jira] [Commented] (IGNITE-13005) Spring Data 2 - "JPA style" and working with multiple Ignite instances on same JVM
[ https://issues.apache.org/jira/browse/IGNITE-13005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147887#comment-17147887 ] Manuel Núñez commented on IGNITE-13005: --- [~ilyak] done. > Spring Data 2 - "JPA style" 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, 2.8.1 >Reporter: Manuel Núñez >Assignee: Manuel Núñez >Priority: Major > Labels: spring-data > Time Spent: 10m > Remaining Estimate: 0h > > I have it working for Spring Data 2 (2.7.6, 2.8.1) module with some > interesting improvements. > 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}}). > Some examples: > {code:java} > // Spring Data Repositories using different ignite instances on same JVM > @RepositoryConfig(igniteInstance = "FLIGHTS_BBDD", cacheName = "ROUTES") > public interface FlightRouteRepository extends IgniteRepository String> { > ... > } > @RepositoryConfig(igniteInstance = "GEO_BBDD", cacheName = "POIS") > public interface PoiRepository extends IgniteRepository { > ... > } > {code} > {code:java} > // named parameter > @Query(value = "SELECT * from #{#entityName} where email = :email") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // indexed parameters > @Query(value = "SELECT * from #{#entityName} where country = ?#{[0] and city > = ?#{[1]}") > List searchUsersByCity(@Param("country") String country, @Param("city") > String city, Pageable pageable); > {code} > {code:java} > // ordered method parameters > @Query(value = "SELECT * from #{#entityName} where email = ?") > User searchUserByEmail(String email); > {code} > {code:java} > // Advanced SpEL expressions > @Query(value = "SELECT * from #{#entityName} where uuidCity = > ?#{mySpELFunctionsBean.cityNameToUUID(#city)}") > List searchUsersByCity(@Param("city") String city, Pageable pageable); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "email: #{#email}") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "#{#textToSearch}") > List searchUsersByText(@Param("textToSearch") String text, Pageable > pageable); > {code} > {code:java} > // textQuery - evaluated SpEL indexed parameter > @Query(textQuery = true, value = "#{[0]}") > List searchUsersByText(String textToSearch, Pageable pageable); > {code} > {code:java} > // Static Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.id, m.name, m.logos ORDER BY m.name") > List searchMerchantsByOrigin(@Param("origin") String origin, > @Param("disabled") boolean disabled); > {code} > {code:java} > // Dynamic Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.id, m.name, m.logos ORDER BY m.name") > Lis
[jira] [Commented] (IGNITE-13005) Spring Data 2 - "JPA style" and working with multiple Ignite instances on same JVM
[ https://issues.apache.org/jira/browse/IGNITE-13005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17143072#comment-17143072 ] Ilya Kasnacheev commented on IGNITE-13005: -- [~mnusan] please fix compilation errors. We can't run MTCGA if there are compilation errors: https://ci.ignite.apache.org/buildConfiguration/IgniteTests24Java8_BuildApacheIgnite/5411396 While you're there, please reformat coding guidelines (such as, else block starting on new line, no blank line on start of method/class, every field/method has a javadoc comment even if empty, @Override on the same line as method name) and fix Travis CI shown on pull request page. https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines > Spring Data 2 - "JPA style" 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, 2.8.1 >Reporter: Manuel Núñez >Assignee: Manuel Núñez >Priority: Major > Labels: spring-data > Time Spent: 10m > Remaining Estimate: 0h > > I have it working for Spring Data 2 (2.7.6, 2.8.1) module with some > interesting improvements. > 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}}). > Some examples: > {code:java} > // Spring Data Repositories using different ignite instances on same JVM > @RepositoryConfig(igniteInstance = "FLIGHTS_BBDD", cacheName = "ROUTES") > public interface FlightRouteRepository extends IgniteRepository String> { > ... > } > @RepositoryConfig(igniteInstance = "GEO_BBDD", cacheName = "POIS") > public interface PoiRepository extends IgniteRepository { > ... > } > {code} > {code:java} > // named parameter > @Query(value = "SELECT * from #{#entityName} where email = :email") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // indexed parameters > @Query(value = "SELECT * from #{#entityName} where country = ?#{[0] and city > = ?#{[1]}") > List searchUsersByCity(@Param("country") String country, @Param("city") > String city, Pageable pageable); > {code} > {code:java} > // ordered method parameters > @Query(value = "SELECT * from #{#entityName} where email = ?") > User searchUserByEmail(String email); > {code} > {code:java} > // Advanced SpEL expressions > @Query(value = "SELECT * from #{#entityName} where uuidCity = > ?#{mySpELFunctionsBean.cityNameToUUID(#city)}") > List searchUsersByCity(@Param("city") String city, Pageable pageable); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "email: #{#email}") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "#{#textToSearch}") > List searchUsersByText(@Param("textToSearch") String text, Pageable > pageable); > {code} > {code:java} > // textQuery - evaluated SpEL indexed parameter > @Query(textQuery = true, value = "#{[0]}") > List searchUsersByText(String textToSearch, Pageable pageable); > {code} > {code:java} > // Static Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.i
[jira] [Commented] (IGNITE-13005) Spring Data 2 - "JPA style" and working with multiple Ignite instances on same JVM
[ https://issues.apache.org/jira/browse/IGNITE-13005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142292#comment-17142292 ] Manuel Núñez commented on IGNITE-13005: --- Done https://github.com/apache/ignite/pull/7953. > Spring Data 2 - "JPA style" 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, 2.8.1 >Reporter: Manuel Núñez >Priority: Major > Labels: spring-data > Time Spent: 10m > Remaining Estimate: 0h > > I have it working for Spring Data 2 (2.7.6, 2.8.1) module with some > interesting improvements. Is there any ignite developer who can do the > pull-request process?. 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}}). > Some examples: > {code:java} > // Spring Data Repositories using different ignite instances on same JVM > @RepositoryConfig(igniteInstance = "FLIGHTS_BBDD", cacheName = "ROUTES") > public interface FlightRouteRepository extends IgniteRepository String> { > ... > } > @RepositoryConfig(igniteInstance = "GEO_BBDD", cacheName = "POIS") > public interface PoiRepository extends IgniteRepository { > ... > } > {code} > {code:java} > // named parameter > @Query(value = "SELECT * from #{#entityName} where email = :email") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // indexed parameters > @Query(value = "SELECT * from #{#entityName} where country = ?#{[0] and city > = ?#{[1]}") > List searchUsersByCity(@Param("country") String country, @Param("city") > String city, Pageable pageable); > {code} > {code:java} > // ordered method parameters > @Query(value = "SELECT * from #{#entityName} where email = ?") > User searchUserByEmail(String email); > {code} > {code:java} > // Advanced SpEL expressions > @Query(value = "SELECT * from #{#entityName} where uuidCity = > ?#{mySpELFunctionsBean.cityNameToUUID(#city)}") > List searchUsersByCity(@Param("city") String city, Pageable pageable); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "email: #{#email}") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "#{#textToSearch}") > List searchUsersByText(@Param("textToSearch") String text, Pageable > pageable); > {code} > {code:java} > // textQuery - evaluated SpEL indexed parameter > @Query(textQuery = true, value = "#{[0]}") > List searchUsersByText(String textToSearch, Pageable pageable); > {code} > {code:java} > // Static Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.id, m.name, m.logos ORDER BY m.name") > List searchMerchantsByOrigin(@Param("origin") String origin, > @Param("disabled") boolean disabled); > {code} > {code:java} > // Dynamic Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :orig
[jira] [Commented] (IGNITE-13005) Spring Data 2 - "JPA style" and working with multiple Ignite instances on same JVM
[ https://issues.apache.org/jira/browse/IGNITE-13005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142037#comment-17142037 ] Ilya Kasnacheev commented on IGNITE-13005: -- Please create a pull-request. [~mnusan] > Spring Data 2 - "JPA style" 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, 2.8.1 >Reporter: Manuel Núñez >Priority: Major > Labels: spring-data > > I have it working for Spring Data 2 (2.7.6, 2.8.1) module with some > interesting improvements. Is there any ignite developer who can do the > pull-request process?. 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}}). > Some examples: > {code:java} > // Spring Data Repositories using different ignite instances on same JVM > @RepositoryConfig(igniteInstance = "FLIGHTS_BBDD", cacheName = "ROUTES") > public interface FlightRouteRepository extends IgniteRepository String> { > ... > } > @RepositoryConfig(igniteInstance = "GEO_BBDD", cacheName = "POIS") > public interface PoiRepository extends IgniteRepository { > ... > } > {code} > {code:java} > // named parameter > @Query(value = "SELECT * from #{#entityName} where email = :email") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // indexed parameters > @Query(value = "SELECT * from #{#entityName} where country = ?#{[0] and city > = ?#{[1]}") > List searchUsersByCity(@Param("country") String country, @Param("city") > String city, Pageable pageable); > {code} > {code:java} > // ordered method parameters > @Query(value = "SELECT * from #{#entityName} where email = ?") > User searchUserByEmail(String email); > {code} > {code:java} > // Advanced SpEL expressions > @Query(value = "SELECT * from #{#entityName} where uuidCity = > ?#{mySpELFunctionsBean.cityNameToUUID(#city)}") > List searchUsersByCity(@Param("city") String city, Pageable pageable); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "email: #{#email}") > User searchUserByEmail(@Param("email") String email); > {code} > {code:java} > // textQuery - evaluated SpEL named parameter > @Query(textQuery = true, value = "#{#textToSearch}") > List searchUsersByText(@Param("textToSearch") String text, Pageable > pageable); > {code} > {code:java} > // textQuery - evaluated SpEL indexed parameter > @Query(textQuery = true, value = "#{[0]}") > List searchUsersByText(String textToSearch, Pageable pageable); > {code} > {code:java} > // Static Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.id, m.name, m.logos ORDER BY m.name") > List searchMerchantsByOrigin(@Param("origin") String origin, > @Param("disabled") boolean disabled); > {code} > {code:java} > // Dynamic Projection > @Query(value = >"SELECT DISTINCT m.id, m.name, m.logos FROM #{#entityName} e > USE INDEX (ORIGIN_IDX) INNER JOIN \"flightMerchants\".Merchant m ON m" >+ "._key=e" >+ ".merchant WHERE e.origin = :origin and e.disabled = > :disabled GROUP BY m.id, m.name,