Skip to content

Commit

Permalink
Smoke test for issue with JPA call from init method
Browse files Browse the repository at this point in the history
  • Loading branch information
derkoe committed Jul 4, 2023
1 parent 6a09605 commit 070b130
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.data.jpa;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

@Service
public class AppInitializer implements InitializingBean {

private AuthorRepository authorRepository;

public AppInitializer(AuthorRepository authorRepository) {
this.authorRepository = authorRepository;
}

@Override
public void afterPropertiesSet() throws Exception {
authorRepository.findByNameContainingIgnoreCase("name");
}

}

0 comments on commit 070b130

Please sign in to comment.