You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/04/15 13:50:02 UTC

[GitHub] [ignite-extensions] tkalkirill commented on a change in pull request #55: IGNITE-13169 Remove Ignite bean name requirement for Spring Data Repository

tkalkirill commented on a change in pull request #55:
URL: https://github.com/apache/ignite-extensions/pull/55#discussion_r614084200



##########
File path: modules/spring-data-2.0-ext/src/main/java/org/apache/ignite/springdata20/repository/support/IgniteProxyFactory.java
##########
@@ -137,4 +139,29 @@ private IgniteProxy createIgniteProxy(Class<?> repoInterface) {
     private String evaluateExpression(String spelExpression) {
         return (String)expressionResolver.evaluate(spelExpression, beanExpressionCtx);
     }
+
+    /**
+     * Helper interface that wraps getBean method.

Review comment:
       Add getBean as @link

##########
File path: modules/spring-data-2.0-ext/src/main/java/org/apache/ignite/springdata20/repository/support/IgniteProxyFactory.java
##########
@@ -137,4 +139,29 @@ private IgniteProxy createIgniteProxy(Class<?> repoInterface) {
     private String evaluateExpression(String spelExpression) {
         return (String)expressionResolver.evaluate(spelExpression, beanExpressionCtx);
     }
+
+    /**
+     * Helper interface that wraps getBean method.
+     */
+    @FunctionalInterface
+    private interface BeanFinder {
+        /**
+         * Get bean.
+         * @return Bean or null if {@link BeansException} was thrown.
+         */
+        default Object getBean() {

Review comment:
       @nullable forget

##########
File path: modules/spring-data-2.0-ext/src/main/java/org/apache/ignite/springdata20/repository/support/IgniteProxyFactory.java
##########
@@ -137,4 +139,29 @@ private IgniteProxy createIgniteProxy(Class<?> repoInterface) {
     private String evaluateExpression(String spelExpression) {
         return (String)expressionResolver.evaluate(spelExpression, beanExpressionCtx);
     }
+
+    /**
+     * Helper interface that wraps getBean method.
+     */
+    @FunctionalInterface
+    private interface BeanFinder {
+        /**
+         * Get bean.
+         * @return Bean or null if {@link BeansException} was thrown.
+         */
+        default Object getBean() {
+            try {
+                return get();
+            } catch (BeansException ex) {
+                return null;
+            }
+        }
+
+        /**
+         * Get bean.

Review comment:
       Maybe: Getting a bean.
   New line after description.

##########
File path: modules/spring-data-2.0-ext/src/main/java/org/apache/ignite/springdata20/repository/support/IgniteProxyFactory.java
##########
@@ -137,4 +139,29 @@ private IgniteProxy createIgniteProxy(Class<?> repoInterface) {
     private String evaluateExpression(String spelExpression) {
         return (String)expressionResolver.evaluate(spelExpression, beanExpressionCtx);
     }
+
+    /**
+     * Helper interface that wraps getBean method.
+     */
+    @FunctionalInterface
+    private interface BeanFinder {
+        /**
+         * Get bean.

Review comment:
       Maybe: Getting a bean.
   New line after description.

##########
File path: modules/spring-data-2.0-ext/src/test/java/org/apache/ignite/springdata/IgniteSpringDataConnectionConfigurationTest.java
##########
@@ -75,6 +76,30 @@ public void testRepositoryWithClientConfiguration() {
         checkRepositoryConfiguration(ClientConfigurationApplication.class, IgniteClientConfigRepository.class);
     }
 
+    /** Tests repository configuration in case {@link Ignite} with non default is used to access the Ignite cluster. */
+    @Test
+    public void testRepositoryWithoutIgniteInstanceParameter() {
+        checkRepositoryConfiguration(DefaultIgniteBeanApplication.class, IgniteRepositoryWithoutExplicitIgnite.class);
+    }
+
+    /** Tests repository configuration in case {@link IgniteClient} with non default name is used to access the Ignite cluster. */

Review comment:
       Why 1 line?

##########
File path: modules/spring-data-2.0-ext/src/test/java/org/apache/ignite/springdata/IgniteSpringDataConnectionConfigurationTest.java
##########
@@ -75,6 +76,30 @@ public void testRepositoryWithClientConfiguration() {
         checkRepositoryConfiguration(ClientConfigurationApplication.class, IgniteClientConfigRepository.class);
     }
 
+    /** Tests repository configuration in case {@link Ignite} with non default is used to access the Ignite cluster. */
+    @Test
+    public void testRepositoryWithoutIgniteInstanceParameter() {
+        checkRepositoryConfiguration(DefaultIgniteBeanApplication.class, IgniteRepositoryWithoutExplicitIgnite.class);
+    }
+
+    /** Tests repository configuration in case {@link IgniteClient} with non default name is used to access the Ignite cluster. */
+    @Test
+    public void testRepositoryWithoutIgniteClientInstanceParameter() {
+        checkRepositoryConfiguration(DefaultIgniteClientBeanApplication.class, IgniteRepositoryWithoutExplicitIgnite.class);
+    }
+
+    /** Tests repository configuration in case {@link ClientConfiguration} with non default name is used to access the Ignite cluster. */

Review comment:
       Why 1 line?

##########
File path: modules/spring-data-2.0-ext/src/test/java/org/apache/ignite/springdata/IgniteSpringDataConnectionConfigurationTest.java
##########
@@ -75,6 +76,30 @@ public void testRepositoryWithClientConfiguration() {
         checkRepositoryConfiguration(ClientConfigurationApplication.class, IgniteClientConfigRepository.class);
     }
 
+    /** Tests repository configuration in case {@link Ignite} with non default is used to access the Ignite cluster. */
+    @Test
+    public void testRepositoryWithoutIgniteInstanceParameter() {
+        checkRepositoryConfiguration(DefaultIgniteBeanApplication.class, IgniteRepositoryWithoutExplicitIgnite.class);
+    }
+
+    /** Tests repository configuration in case {@link IgniteClient} with non default name is used to access the Ignite cluster. */
+    @Test
+    public void testRepositoryWithoutIgniteClientInstanceParameter() {
+        checkRepositoryConfiguration(DefaultIgniteClientBeanApplication.class, IgniteRepositoryWithoutExplicitIgnite.class);
+    }
+
+    /** Tests repository configuration in case {@link ClientConfiguration} with non default name is used to access the Ignite cluster. */
+    @Test
+    public void testRepositoryWithoutIgnitClientConfigurationParameter() {
+        checkRepositoryConfiguration(DefaultIgniteClientConfigurationBeanApplication.class, IgniteRepositoryWithoutExplicitIgnite.class);
+    }
+
+    /** Tests repository configuration in case {@link IgniteConfiguration} with non default name is used to access the Ignite cluster. */

Review comment:
       Why 1 line?

##########
File path: modules/spring-data-2.0-ext/src/test/java/org/apache/ignite/springdata/IgniteSpringDataConnectionConfigurationTest.java
##########
@@ -75,6 +76,30 @@ public void testRepositoryWithClientConfiguration() {
         checkRepositoryConfiguration(ClientConfigurationApplication.class, IgniteClientConfigRepository.class);
     }
 
+    /** Tests repository configuration in case {@link Ignite} with non default is used to access the Ignite cluster. */

Review comment:
       Why 1 line?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org