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,30 @@
|
||||
package com.avaje.tests.basic;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.OrderBy;
|
||||
import com.avaje.ebean.Query;
|
||||
import com.avaje.tests.model.basic.Order;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestQueryParse extends TestCase {
|
||||
|
||||
public void test() {
|
||||
//GlobalProperties.put("ebean.ddl.generate", "false");
|
||||
//GlobalProperties.put("ebean.ddl.run", "false");
|
||||
ResetBasicData.reset();
|
||||
|
||||
String oql = "where 1=1 order by customer.name desc, status";
|
||||
Query<Order> query = Ebean.createQuery(Order.class, oql);
|
||||
|
||||
OrderBy<Order> order = query.order();
|
||||
Assert.assertTrue(order.getProperties().size() == 2);
|
||||
Assert.assertEquals("customer.name",order.getProperties().get(0).getProperty());
|
||||
Assert.assertFalse(order.getProperties().get(0).isAscending());
|
||||
Assert.assertEquals("status",order.getProperties().get(1).getProperty());
|
||||
Assert.assertTrue(order.getProperties().get(1).isAscending());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user