Skip to content

Question about spring data jdbc and kotlin code gen #3036

Answered by F43nd1r
ichenhe asked this question in Q&A
Discussion options

You must be logged in to vote

querydsl-kotlin-codegen does exactly one thing: It replaces all java code generation in querydsl-apt with kotlin code. It's only used in addition to the apt module:

 kapt("com.querydsl:querydsl-apt:5.0.0:jpa")
 kapt("com.querydsl:querydsl-kotlin-codegen:5.0.0")

You don't need this just because your project is using kotlin, but it brings some advantages:

  • no need for java compilation improves build performance (only if you have no other (generated) java sources)
  • lazy QClass fields allow for arbitrarily deep field access without any configuration even with circular entity dependencies
  • nullsafety (this is just a general advantage of kotlin over java, no specific problem case known to me)

I…

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@F43nd1r
Comment options

@F43nd1r
Comment options

@ichenhe
Comment options

@jwgmeligmeyling
Comment options

@ichenhe
Comment options

Answer selected by ichenhe
Comment options

You must be logged in to vote
3 replies
@F43nd1r
Comment options

@alvistar
Comment options

@ArchieLabs
Comment options

Comment options

You must be logged in to vote
1 reply
@GourdErwa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants