-
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.
[FO-1037] sql in 문에 값이 없는 경우 true으로 변환되는 문제 픽스 (#434)
- Loading branch information
1 parent
3841cbd
commit 20f8bd0
Showing
10 changed files
with
175 additions
and
125 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
common/src/main/kotlin/com/fone/common/config/jpa/JdslExt.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,15 @@ | ||
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 | ||
|
||
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.