Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Naming a finder findAll injects the one from SimpleJpaRepository instead of my own.

$
0
0
Hi,

I have a finder I named findAll as in:
Code:

@Query("SELECT es FROM ElearningSubscription es, UserAccount ua WHERE es.userAccount.id = ua.id ORDER BY ua.firstname, ua.lastname, es.subscriptionDate DESC")
public Page<ElearningSubscription> findAll(Pageable page);

But it is not used when running the integration test.

Instead, it is the findAll of the SimpleJpaRepository that is being injected, and not mine.

Here is how my repository is injected in the test context:
Code:

@Autowired
ElearningSubscriptionRepository elearningSubscriptionRepository;

If I rename my finder from findAll to findAllPlease then it is called fine and the integration test passes.

Is there a way to have the framework call my findAll finder ?

I stumbled on this issue in the context of what I thought was another one:
http://forum.springsource.org/showth...d=1#post454111

Viewing all articles
Browse latest Browse all 297

Trending Articles