exposed-0.46でdeperecatedのワーニングが出る
exposedの0.46が出ていたので0.44 ⇒ 0.46にバージョンアップしてみると、
implementation("org.jetbrains.exposed:exposed-spring-boot-starter:0.46.0")
DSLで何やら、deprecatedなワーニングが・・・
slice()とselect()のところで出ていますね。
'slice(Expression<*>, vararg Expression<*>): FieldSet' is deprecated. As part of SELECT DSL design changes, this will be removed in future releases.
'select(SqlExpressionBuilder.() -> Op<Boolean>): Query' is deprecated. As part of SELECT DSL design changes, this will be removed in future releases.
0.46.0でDSLの書き方が変わったようです。
exposd公式のドキュメントを見ても、何がどう変わったのか明確にはかかれていません。
exposed DSL
ChangeLog.mdの0.46のところを見ると、
Features:
feat: EXPOSED-65 Design query DSL consistent with SQL language by @bog-walk in #1916
More details in the Migration guide
どうやらこれのようです。Migration guideを見ると、
// Example 1
// before
TestTable
.slice(TestTable.columnA)
.select { TestTable.columnA eq 1 }
// after
TestTable
.select(TestTable.columnA)
.where { TestTable.columnA eq 1 }
slice ⇒ select
select ⇒ where
に変わっています。上記のexposed DSLのドキュメントも、よく見ると
もこれに合わせた書き方に変わっています。