line / kotlin-jdsl

Kotlin library that makes it easy to build and execute queries without generated metamodel
https://kotlin-jdsl.gitbook.io/docs/
Apache License 2.0
686 stars 85 forks source link

사용법 문의 #76

Closed LeeMH closed 2 years ago

LeeMH commented 2 years ago

안녕하세요. 이번 자그마한 프로젝트에 queryDSL 대신 jdsl 넣어서 개발중입니다. 좋은 라이브러리 만들어 주셔서 감사합니다. 사용중 궁금한 점이 있어 문의 드립니다.

사용환경

  1. 단건 select 방법
  1. @Embedded 타입에 대한 column 사용법
@Embeddable
class UpdatedAt(
    @Column(name = "updated_at")
    val ts: Long,

    @Column(name = "updated_date")
    val date: String,

    @Column(name = "updated_time")
    val time: String
) {
    companion object {
        fun create(ts: Long): UpdatedAt {
            return UpdatedAt(ts, toDateStr(ts), toTimeStr(ts))
        }
    }
}
cj848 commented 2 years ago

You can refer to . https://github.com/line/kotlin-jdsl#associate

You can use it.

associate(SomeObject::updatedAt)
where(col(UpdatedAt::ts).equal(value)

-- korean https://github.com/line/kotlin-jdsl#associate 를 참고하시면 되겠습니다.

associate(SomeObject::updatedAt) where(col(UpdatedAt::ts).equal(value)

형태로 쓰시면 됩니다.

LeeMH commented 2 years ago

@cj848

감사합니다. :-)