mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-26 23:22:57 +00:00
add global configuration disableLazyLoading (#1548)
This commit is contained in:
1 parent
68da8944ed
commit
b3584a81b4
4 files changed
+41
-1
No files matched your search
@@ -229,6 +229,8 @@ public class ServerConfig {
|
||||
|
||||
private int persistBatchSize = 20;
|
||||
|
||||
private boolean disableLazyLoading;
|
||||
|
||||
/**
|
||||
* The default batch size for lazy loading
|
||||
*/
|
||||
@@ -927,6 +929,14 @@ public class ServerConfig {
|
||||
this.queryBatchSize = queryBatchSize;
|
||||
}
|
||||
|
||||
public boolean isDisableLazyLoading() {
|
||||
return disableLazyLoading;
|
||||
}
|
||||
|
||||
public void setDisableLazyLoading(boolean disableLazyLoading) {
|
||||
this.disableLazyLoading = disableLazyLoading;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default batch size for lazy loading of beans and collections.
|
||||
*/
|
||||
@@ -2896,6 +2906,7 @@ public class ServerConfig {
|
||||
localTimeWithNanos = p.getBoolean("localTimeWithNanos", localTimeWithNanos);
|
||||
jodaLocalTimeMode = p.get("jodaLocalTimeMode", jodaLocalTimeMode);
|
||||
|
||||
disableLazyLoading = p.getBoolean("disableLazyLoading", disableLazyLoading);
|
||||
lazyLoadBatchSize = p.getInt("lazyLoadBatchSize", lazyLoadBatchSize);
|
||||
queryBatchSize = p.getInt("queryBatchSize", queryBatchSize);
|
||||
|
||||
|
||||
@@ -284,6 +284,7 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
this.orderById = server.getServerConfig().isDefaultOrderById();
|
||||
this.expressionFactory = expressionFactory;
|
||||
this.detail = new OrmQueryDetail();
|
||||
this.disableLazyLoading = server.getServerConfig().isDisableLazyLoading();
|
||||
}
|
||||
|
||||
public void setNativeSql(String nativeSql) {
|
||||
|
||||
Reference in new issue
Block a user