Skip to content

momosetkn/doma-kotlin-migrate

Repository files navigation

doma-kotlin-migrate

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.

Step1 - Install

Add dependency

repositories {
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    implementation("com.github.momosetkn:doma-kotlin-migrate:1.0.0")
}

Step2 - Replace your code

Replace to KQueryDsl from KEntityql by your IDE.

Step3 - Add import

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' {} +

Step4 - Replace deprecated with JetBrains IDE

Alt + Enter(I you use Mac OS, Option + Return) on target code. Click Replace uses of....

Screenshot from 2024-10-13 09-16-32

About

A product for migrating to QueryDsl with doma-kotlin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages