-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
com.fone.common.config.jpa.inValues 추가. 기존
in
함수 대신 호출하도록 변경. inVal…
…ues는 빈 List가 주어진 경우 false으로 되도록 구현
- Loading branch information
1 parent
3841cbd
commit 2e90aff
Showing
10 changed files
with
177 additions
and
125 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
common/src/main/kotlin/com/fone/common/config/jpa/DslConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.fone.common.config.jpa | ||
|
||
import com.linecorp.kotlinjdsl.query.spec.expression.ExpressionSpec | ||
import com.linecorp.kotlinjdsl.query.spec.expression.LiteralSpec | ||
import com.linecorp.kotlinjdsl.query.spec.predicate.EqualValueSpec | ||
import com.linecorp.kotlinjdsl.query.spec.predicate.InValueSpec | ||
import com.linecorp.kotlinjdsl.query.spec.predicate.PredicateSpec | ||
|
||
class DslConfig | ||
|
||
fun <R> ExpressionSpec<R>.inValues(values: Collection<R>): PredicateSpec { | ||
if (values.isEmpty()) { | ||
// values가 없으면 항상 false이도록 | ||
return EqualValueSpec(LiteralSpec(1), 0) | ||
} | ||
return InValueSpec(this, values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.