A product for migrating to QueryDsl with doma-kotlin. It provides Extensions functions like to Entityql, with @Deprecated. You can migrate to QueryDsl with minimal changes to your existing code.
Add dependency
repositories {
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("com.github.momosetkn:doma-kotlin-migrate:1.0.0")
}
Replace to KQueryDsl
from KEntityql
by your IDE.
Add import to your code.
import momosetkn.doma.migrate.querydsl.*
// If you avoid wild import. please use bellow code.
import momosetkn.doma.migrate.querydsl.delete
import momosetkn.doma.migrate.querydsl.update
import momosetkn.doma.migrate.querydsl.insert
You can add imports in bulk with the following shell.
find src/main/kotlin/<target_package> -type f -name "*.kt" -exec sed -i 's/^\(package .*\)/\1\n\nimport momosetkn.doma.migrate.querydsl.*/g' {} +
# If you avoid wild import. please use bellow code.
find src/main/kotlin/<target_package> -type f -name "*.kt" -exec sed -i 's/^\(package .*\)/\1\n\nimport momosetkn.doma.migrate.querydsl.delete\nimport momosetkn.doma.migrate.querydsl.insert\nimport momosetkn.doma.migrate.querydsl.update/g' {} +
Alt + Enter(I you use Mac OS, Option + Return) on target code.
Click Replace uses of...
.