Skip to content

Commit 26950bc

Browse files
committed
Fix bad merge
1 parent 340a1f1 commit 26950bc

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

grails-data-hibernate5/dbmigration/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ dependencies {
7979

8080
// Liquibase uses JUL for logging -> redirect it to SLF4J to reliably capture its output
8181
testRuntimeOnly 'org.slf4j:jul-to-slf4j'
82-
testRuntimeOnly 'org.slf4j:slf4j-simple'
8382
}
8483

8584
tasks.named('test', Test) {

grails-test-examples/hibernate5/criteria-extension/src/main/groovy/example/extensions/CriteriaBuilderExtensions.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
package example.extensions
2121

2222
import groovy.transform.CompileStatic
23-
import grails.gorm.CriteriaBuilder
23+
import org.grails.datastore.mapping.query.api.Criteria
2424

2525
/**
26-
* Groovy extension module methods added to CriteriaBuilder.
26+
* Groovy extension module methods added to Criteria.
2727
*
2828
* Registered via META-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule.
2929
*/
@@ -40,7 +40,7 @@ class CriteriaBuilderExtensions {
4040
* @param value the candidate value; null or blank strings are ignored
4141
* @param trim whether to trim String values before the null check (default true)
4242
*/
43-
static void eqIf(CriteriaBuilder self, String attribute, Object value, boolean trim = true) {
43+
static void eqIf(Criteria self, String attribute, Object value, boolean trim = true) {
4444
Object sanitized = sanitize(value, trim)
4545
if (sanitized != null) {
4646
self.eq attribute, sanitized

grails-test-examples/hibernate5/criteria-extension/src/test/groovy/example/NumberLikeExpressionSpec.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class NumberLikeExpressionSpec extends Specification {
5454

5555
where:
5656
value || expectedSql
57-
'100' || "trim(to_char(trunc(price_col,0), '999999999999999999999999990')) like ?"
58-
'99.9' || "trim(to_char(trunc(price_col,1), '999999999999999999999999990.9')) like ?"
59-
'99.99' || "trim(to_char(trunc(price_col,2), '999999999999999999999999990.99')) like ?"
60-
'1%' || "trim(to_char(trunc(price_col,0), '999999999999999999999999990')) like ?"
61-
'9.9%' || "trim(to_char(trunc(price_col,1), '999999999999999999999999990.9')) like ?"
57+
'100' || 'cast(price_col as varchar) like ?'
58+
'99.9' || 'cast(price_col as varchar) like ?'
59+
'99.99' || 'cast(price_col as varchar) like ?'
60+
'1%' || 'cast(price_col as varchar) like ?'
61+
'9.9%' || 'cast(price_col as varchar) like ?'
6262
}
6363

6464
void "toSqlString strips commas from value in constructor"() {
@@ -70,7 +70,7 @@ class NumberLikeExpressionSpec extends Specification {
7070
String sql = expr.toSqlString(criteria, criteriaQuery)
7171

7272
then:
73-
sql == "trim(to_char(trunc(price_col,2), '999999999999999999999999990.99')) like ?"
73+
sql == 'cast(price_col as varchar) like ?'
7474
}
7575

7676
void "toSqlString throws HibernateException for multi-column properties"() {

0 commit comments

Comments
 (0)