Leon
11/17/2019, 8:43 PMjbnizet
11/17/2019, 11:25 PMjubril
11/18/2019, 10:31 AMHullaballoonatic
11/18/2019, 5:43 PM@Bean
fun springClassInstance() = SpringClass().apply {
setA(a)
setB(b)
setC(c)
}
this syntax just makes me cry. it's a shame there can't be more constructor variants or at the very least builders for some of these classes...
it would be so much nicer to just be
@Bean fun springClassInstance() = SpringClass(a = a, b = b, c = c)
but you know.... java things.
nvm me, complaining to the etherHullaballoonatic
11/18/2019, 7:01 PMinterface Repository<E : MyEntity> : JpaRepository<E, String> {
operator fun contains(id: String) = existsById(id)
operator fun get(id: String) = findByIdOrNull(id)
}
I'm exploring the possibility of having route controllers talk directly to repos, but a service in the middle to transform dao and dto is probably still too useful to warrant thatpavel
11/21/2019, 10:06 PMsdeleuze
11/22/2019, 2:16 PMRouterFunctionDsl
) constructors internal via internal constructor
since they are intended to be used only via builder functions like router { }
, bean { }
or extensions like mockMvc.get()
. Any objection?aaverin
11/26/2019, 10:45 AMkotlinx.serialization
with SpringBoot? Or it’s not a good idea to explore this?EricJTurley
11/26/2019, 7:50 PM@ConstructorBinding
@ConfigurationProperties("push")
data class PushServicesProperties(val snsClient: SnsClient) {
data class SnsClient(
val maxConnections: Int,
val connectionTimeout: Int,
val socketTimeout: Int,
val proxyHost: String,
val proxyPort: Int
)
}
But I'm still getting No default constructor found
for the PushServiceProperties
class.
Has anyone else had that problem? Everything looks normal...Alex Ku3menk0
11/28/2019, 11:45 AMNo qualifying bean of type 'kotlin.coroutines.CoroutineContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
My controller looks like:
@Controller
class MobileController {
@PostMapping("/register")
suspend fun register() {
...
}
}
and my test:
@WebFluxTest(MobileController::class)
internal class MobileControllerTest {
@Autowired
lateinit var client: WebTestClient
@Test
fun handleRegister() = kotlinx.coroutines.runBlocking {
<http://client.post|client.post>()
.uri("/register")
.exchange()
.expectStatus().isOk
}
}
Does anyone know how to fix it?
Thanks in advance 🙂Lukasz Mlynik
12/01/2019, 5:34 PMdata class Pet (
@get:NotNull
@JsonProperty("name") val name: kotlin.String,
@get:NotNull
@JsonProperty("photoUrls") val photoUrls: kotlin.collections.List<kotlin.String>,
@JsonProperty("id") val id: kotlin.Long? = null,
@JsonProperty("category") val category: Category? = null,
@JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
@JsonProperty("status") val status: Pet.Status? = null
)
tiare.balbi
12/03/2019, 5:31 AMkotlin('plugin.allopen')
was added to the gradle.
@Component
class UserRestConfigurer : RepositoryRestConfigurer {
override fun configureRepositoryRestConfiguration(config: RepositoryRestConfiguration) {
config.withEntityLookup()
.forRepository<User, Long, UserRepository>(UserRepository::class.java)
.withIdMapping(User::email)
.withLookup(UserRepository::findByEmail)
}
}
Czar
12/03/2019, 2:11 PM@Configuration class MyConf(private val someBean: SomeBean) {
@Bean fun myBean(): MyBean { /* do something with someBean */ }
}
and
@Configuration class MyConf {
@Bean fun myBean(someBean: SomeBean): MyBean { /* do something with someBean */ }
}
But I don't remember either which video it was or what was the difference. Googling around didn't yield any results yet.
Does anyone remember/know what I'm talking about?bjonnh
12/04/2019, 9:30 PMcpe
12/06/2019, 10:29 AMYousef
12/06/2019, 5:18 PMRobert Jaros
12/08/2019, 11:24 AMRoy Nard
12/09/2019, 2:43 PMpdegand
12/09/2019, 2:55 PMrunBlocking { }
inside the WebMVC controller until all of the controller are refactored, and when we are ready, to remove the dependency to webmvc to enable the full reactive stack, remove all the runBlocking
and convert the controller methods to suspend
?Czar
12/12/2019, 1:20 PM@Component class MyComponent(...) {
fun someFun() {
/* do something non-transactional before the transaction */
inTransaction(txType = TxType.REQUIRED, readOnly = false) {
/* do something inside a transaction */
}
/* do something non-transactional after the transaction */
}
}
What would be the best way to implement the inTransaction
fun?tjb
12/18/2019, 5:18 PMDave Jensen
12/18/2019, 7:16 PMdata class
for the Entity but, unless I'm missing something, I'm not sure that should matter. Has anybody successfully used a delegate in their entities?Karolis
01/06/2020, 8:54 AMpackage-info.java
file near my Kotlin code. It works while I run my app from IDE, but if I package app as a fat jar (gradle bootJar
), it stops working. The only fix I came across is to place the package-info in src/java
instead of src/kotlin
. Is there a way to instruct gradle to include package-info.java to resulting spring boot jar?Naveenkumar R
01/06/2020, 2:08 PMbjonnh
01/10/2020, 5:17 PMEarthCitizen
01/13/2020, 5:10 PMrunBlocking { }
?Dariusz Kuc
01/13/2020, 5:40 PMtestClient.get()
.uri("whatever")
.accept(APPLICATION_JSON)
.exchange()
.expectStatus().isOk
.expectBody()
.jsonPath("$.whatever").isEqualTo(null) // NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS
If I enable jsr305=strict
compiler settings the above fails complaining it expects non-null Any
bjonnh
01/15/2020, 5:32 PMSindy Senorita
01/16/2020, 12:17 AMmvn clean package
, the library module compiles successfully but the application module does not find the library module with error Unresolved reference: thelibrarymodule
This sounds like a classic spring boot problem, but no post in internet seem to have proper fix/explanation. This is driving me insane
Can someone please help me? any explanation of the root cause or any suggested keyword to google with?
Thanks in advanceviralshah
01/19/2020, 3:38 PM