mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
initial add of EbeanORM server based on v2.8.1
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.avaje.tests.query;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.Query;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestIContains extends TestCase {
|
||||
|
||||
public void testIContains() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
// case insensitive
|
||||
Query<Customer> q0 = Ebean.find(Customer.class)
|
||||
.where().icontains("name", "Rob")
|
||||
.query();
|
||||
|
||||
|
||||
q0.findList();
|
||||
String generatedSql = q0.getGeneratedSql();
|
||||
|
||||
Assert.assertTrue(generatedSql.contains("lower(t0.name)"));
|
||||
|
||||
|
||||
// not case insensitive
|
||||
q0 = Ebean.find(Customer.class)
|
||||
.where().contains("name", "Rob")
|
||||
.query();
|
||||
|
||||
|
||||
q0.findList();
|
||||
generatedSql = q0.getGeneratedSql();
|
||||
|
||||
Assert.assertTrue(generatedSql.contains(" t0.name "));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user