Consider the following custom repository interface:Its implementation:Code:@NoRepositoryBean public interface CustomRepository<T, ID extends Serializable> extends JpaRepository<T,ID> { void doSomethingInteresting(); // common to all repositories }Another custom repository interface:Code:public class SimpleJpaCustomRepository<T, ID extends Serializable> extends SimpleJpaRepository<T,ID> { public void doSomethingInteresting() { /* ... */ } }Now, if the implementation of findByBarStartingWith isCode:public interface FooRepository extends CustomRepository<Foo,Long> { List<Foo> findByBarLike(String criteria); // SD JPA dynamic finder List<Foo> findByBarStartingWith(String criteria); // my own finder }in what class do I put this method yet still have SD JPA provide an implementation of findByBarLike? Would it be available via this or some other reference? How would I configure this in my Spring context?Code:public List<Foo> findByBarStartingWith(String criteria) { String intendedCriteria = criteria.replace("_", "\\_").replace("%", "\\%") + "%"; return findByBarLike(intendedCriteria); // from SD JPA via "this"? }


Reply With Quote