import org.springframework.beans.factory.annotation.Autowiredopen class AppUserJdbcRepository {
private var jdbcTemplate: JdbcTemplate?= null
fun findByFirstName(f
我正在我的测试类中为jdbcTemaplte创建一个新实例。我使用H2 DB进行单元测试,并且能够使用jdbcTemplate实例创建或更新tables.It工作正常。但是当它转到实际的类时,它的测试jdbcTemplate是空的,这会抛出NullPointerException@RunWith(SpringJUnit4ClassRunner.class(name = "jdbcTemplate")
public JdbcTemplate or
我有一个SpringBoot应用程序,希望访问构造函数中提供的JdbcTemplate。我试图在类实例化时缓存数据库中的一些数据。我的Groovy代码如下所示:class EarthquakeRepository {
private final JdbcTemplatejdbcTemplatepublic EarthquakeRespository() { ass