mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
Support EntityBeanIntercept as an interface with InterceptReadWrite and InterceptReadOnly options
With the view that we can optimise the readOnly + disableLazyLoad case by using InterceptReadOnly which doesn't need to support any of the flags used as part of mutation.
This commit is contained in:
1 parent
d55223f9f5
commit
5ab02715ef
25 files changed
+1797
-869
No files matched your search
@@ -5,11 +5,15 @@ import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TestQueryOrderById extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void orderById_default_expectNotOrderById() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Customer> query = DB.find(Customer.class)
|
||||
.select("id,name")
|
||||
@@ -17,7 +21,8 @@ public class TestQueryOrderById extends BaseTestCase {
|
||||
.setFirstRow(1)
|
||||
.setMaxRows(5);
|
||||
|
||||
query.findList();
|
||||
query.setReadOnly(true).setDisableLazyLoading(true);
|
||||
List<Customer> list = query.findList();
|
||||
if (isSqlServer() || isDb2()) {
|
||||
assertSql(query).isEqualTo("select t0.id, t0.name from o_customer t0 order by t0.id offset 1 rows fetch next 5 rows only");
|
||||
} else if (!isOracle()) {
|
||||
|
||||
Reference in new issue
Block a user