and now that you are using everything explicit, yo...
# spring
n
and now that you are using everything explicit, you need to... no magic anymore, that’s the trade-off no magic means no instantiation of beans behind your back you need to declare everything by yourself
g
@nfrankel thanks, in my case can you help me how to explicitly instantiate
NamedParameterJbcTemplate
n
i’d say
bean<NamedParameterJbcTemplate>()
g
I did try, didn’t work
Will ping you the stacktrace in a while
n
you need a
DataSource
bean available do you have one?
more importantly, you understand kofu is an experimental sandbox, right? meaning, it’s not meant for “real” projects but to try out new ideas
g
This worked, so apparently kofu doesn’t pick from application.properties file
Copy code
val dataConfig = configuration {
    beans {
		bean {
			val dataSourceBuilder = DataSourceBuilder.create()
			dataSourceBuilder.driverClassName("org.h2.Driver")
			dataSourceBuilder.url("jdbc:h2:mem:test")
			dataSourceBuilder.username("SA")
			dataSourceBuilder.password("")
			dataSourceBuilder.build()
		}
		bean<NamedParameterJdbcTemplate>()
        bean<UserRepository>()
    }
    listener<ApplicationReadyEvent> {
        ref<UserRepository>().init()
    }
}
n
kofu doesn’t pick from application.properties
nope because this is implicit ko-fu makes everything explicit
you can’t have the cake and eat it too 😉
g
😄