Closed shouwn closed 1 year ago
@shouwn I have some question during implementing test for this. According to JPQL docs, Like expression has the following syntax.
string_expression [NOT] LIKE pattern_value [ESCAPE escape_character]
However, JpqlLike
does not have property for escape character.
@Internal
data class JpqlLike internal constructor(
val value: Expression<String>,
val pattern: Expression<String>,
) : Predicate
I'm curious whether this is something that's missing or if you have plans to add it.
And if you need to add it, I'm wondering whether it would be better to use stringLiteral
from Expressions
or to add a new character literals.
@SinceJdsl("3.0.0")
fun charactreLiteral(char: Char): Expression<Char> {
return JpqlLiteral.CharLiteral(char)
}
@jbl428 Since I have no experience with ESCAPE, I didn't implement it because I didn't know how to actually add it.
Like you said, I looked it up and it seems that ESCAPE only allows one character
, so it seems like a good idea to create a charLiteral()
method.
If you don't mind, could you implement this? You don't need to implement tests of the DSL and QueryModel because I will implement these.
It's okay if you don't implement it! I'd be happy if you just implemented JpqlLikeSerializer
.
Backgrounds
JpqlSerializer
.Requirements
JpqlLike
as a SQL String.Contribution