-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Java objects that generate JOOQ conditions sometimes support wildcards, when the compared value is just a wildcard to match any a true condition could be used instead.
Use case or motivation behind the feature request
Change simplifies resulting conditions and helps the SQL engine to avoid string comparisons.
Related issues
Additional context
if column is nullable a NOT NULL condition could be used.
example of simplification
(
"streamdb"."stream"."directory" like '%'
or (
"streamdb"."stream"."directory" like 'haproxy'
and "streamdb"."stream"."stream" like 'example:haproxy:haproxy'
)
)
would be simplified into
(
"streamdb"."stream"."directory" like 'haproxy'
and "streamdb"."stream"."stream" like 'example:haproxy:haproxy'
)
results from
if ("*".equalsIgnoreCase(value)) {
condition = DSL.trueCondition(); // added always true condition
}
else {
condition = STREAMDB.STREAM.DIRECTORY.like(value.replace('*', '%'));
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request