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 2020/06/25 14:41:11 UTC

[GitHub] [ignite] dmagda commented on a change in pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

dmagda commented on a change in pull request #7949:
URL: https://github.com/apache/ignite/pull/7949#discussion_r444559692



##########
File path: modules/spring-data/src/test/java/org/apache/ignite/springdata/misc/ApplicationConfiguration.java
##########
@@ -37,7 +37,7 @@
      * @return Ignite instance.
      */
     @Bean
-    public Ignite igniteInstance() {

Review comment:
       Let's keep the test where the instance is named as it was required before - "igniteInstance". Just for the sake of backward compatibility. Feel free to add a new one where the bean is named differently.

##########
File path: modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactoryBean.java
##########
@@ -64,13 +64,13 @@ protected IgniteRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
     /** {@inheritDoc} */
     @Override protected RepositoryFactorySupport createRepositoryFactory() {
         try {
-            Ignite ignite = (Ignite)ctx.getBean("igniteInstance");
+            Ignite ignite = ctx.getBean(Ignite.class);
 
             return new IgniteRepositoryFactory(ignite);
         }
         catch (BeansException ex) {
             try {
-                IgniteConfiguration cfg = (IgniteConfiguration)ctx.getBean("igniteCfg");

Review comment:
       Let's keep the "igniteCfg" approach to ensure backward compatibility. Some fo the folks might have already used this approach.




----------------------------------------------------------------
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