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,32 @@
|
||||
package com.avaje.tests.basic;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.Query;
|
||||
import com.avaje.tests.model.basic.Order;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestQueryWhereBetween extends TestCase {
|
||||
|
||||
public void testCountOrderBy() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Timestamp t = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
Query<Order> query = Ebean.find(Order.class)
|
||||
.setAutofetch(false)
|
||||
.where().betweenProperties("cretime","updtime", t)
|
||||
.order().asc("orderDate")
|
||||
.order().desc("id");
|
||||
|
||||
query.findList();
|
||||
|
||||
String sql = query.getGeneratedSql();
|
||||
Assert.assertTrue(sql.indexOf("between t0.cretime and t0.updtime") > -1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user