mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 00:23:24 +00:00
initial add of EbeanORM server based on v2.8.1
This commit is contained in:
1 parent
2b74d0f9d9
commit
96ce4c0ddf
1188 files changed
+135034
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package com.avaje.tests.autofetch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.tests.model.basic.EBasicClob;
|
||||
|
||||
public class MainAutoFetchExcludeLazyLobs {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
GlobalProperties.put("ebean.autofetch.queryTuning", "true");
|
||||
GlobalProperties.put("ebean.autofetch.profiling", "true");
|
||||
|
||||
|
||||
EBasicClob a = new EBasicClob();
|
||||
a.setName("name 1");
|
||||
a.setTitle("a title");
|
||||
a.setDescription("not that meaningful");
|
||||
|
||||
Ebean.save(a);
|
||||
|
||||
List<EBasicClob> list = Ebean.find(EBasicClob.class)
|
||||
.setAutofetch(true)
|
||||
.findList();
|
||||
|
||||
for (EBasicClob bean : list) {
|
||||
bean.getName();
|
||||
// although we read the description
|
||||
// autofetch will not include it later
|
||||
bean.getDescription();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user