title: Extend Spring Data Repository
body: <p>I would like to introduce a <code>&lt;T&gt; T findOrCreate(Supplier&lt;Optional&lt;T&gt;&gt; finder, Supplier&lt;T&gt; factory)</code> to all of my repositories.
  So created a new Interface</p>
  <pre><code>@NoRepositoryBean
  public interface ExtendedJpaRepository&lt;T, ID extends Serializable&gt; extends JpaRepository&lt;T, ID&gt; {
      T findOrCreate(Supplier&lt;Optional&lt;T&gt;&gt; finder, Supplier&lt;T&gt; factory);
  }
  </code></pre>
  <p>.</p>
  <pre><code>public class ExtendedJpaRepositoryImpl&lt;T, ID extends Serializable&gt; extends SimpleJpaRepository&lt;T, ID&gt; implements ExtendedJpaRepository&lt;T, ID&gt; {
  
      private final JpaEntityInformation entityInformation;
      private final EntityManager entityManager;
  
      public ExtendedJpaRepositoryImpl(JpaEntityInformation entityInformation, EntityManager entityManager) {
          super(entityInformation, entityManager);
          this.entityInformation = entityInformation;
          this.entityManager = entityManager;
      }
  
      @Override
      public T findOrCreate(Supplier&lt;Optional&lt;T&gt;&gt; finder, Supplier&lt;T&gt; factory) {
          throw new NotImplementedException(&quot;No implemented yet&quot;);
      }
  }
  </code></pre>
  <p>Then I use this interface in my concrete repositories, e.g. RecipeIngredientRepository:</p>
  <pre><code>public interface RecipeIngredientRepository extends ExtendedJpaRepository&lt;RecipeIngredient, Long&gt; {}
  </code></pre>
  <p>When I finally inject the repository to my service I get the following exception:</p>
  <pre><code>java.lang.IllegalStateException: Failed to load ApplicationContext
  ...
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'recipeIngredientRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property find found for type RecipeIngredient! Did you mean 'id'?
  </code></pre>
  <p>It is searching for a <code>find</code> property in my entitiy <code>RecipeIngredient</code>. I did not want it to do this. I think this is related to <a href="https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods" rel="nofollow noreferrer">JPA Query Methods</a>. So I changed the name from <code>findOrCreate</code> to <code>xxx</code> to Bypass any query method detection - without success. It searches for a <code>xxx</code> property then.</p>
  <p>What does make spring data look for this property?
  I'm using <code>org.springframework.boot:spring-boot-starter-data-jpa</code>.</p>