Dirk
05/25/2023, 12:18 PMJsonValue2
, is designed to extract JSON values from a database column. Here's the class definition:
class JsonValue2<T>(private val column: Expression<*>, override val columnType: IColumnType, private val path: String) : Function<T>(columnType) {
override fun toQueryBuilder(queryBuilder: QueryBuilder) = queryBuilder {
<http://log.info|log.info>("-----> JsonValue shall be generated. column: $column, path: $path, columnType: $columnType")
append("JSON_VALUE(")
column.toQueryBuilder(queryBuilder)
append(", '$")
append(path)
append("')")
}
}
I'm attempting to use this function in a select statement as follows:
Job
.select {
(Job.userID eq uid) and
(JsonValue2<SitzungsId>(Job.daten, SitzungsIDColumnType(), "konfiguration.sitzungsID") inList sitzungsIDs) and
(RowNum eq 1L)
}
However, when inspecting the generated output, the function call does not appear in the WHERE clause, and the result only shows FROM JOB WHERE ROWNUM = 1
.
Could you provide some insights as to why my JsonValue2
function isn't being included in the generated SQL statement? I'm not sure where I've gone wrong.
Thanks in advance for your help!Dominik Sandjaja
05/25/2023, 12:38 PM.userID eq uid
part appear in the generated SQL?Dirk
05/25/2023, 12:58 PM