mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-09-25 03:31:07 +00:00
Merge branch 'master' into ebean-15x
# Conflicts: # ebean-api/src/main/java/io/ebean/config/DatabaseConfig.java # ebean-core/src/main/java/io/ebeaninternal/server/core/DefaultServer.java # ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanPropertyAssocOne.java
This commit is contained in:
@@ -51,11 +51,6 @@ public interface LoadContext {
|
||||
*/
|
||||
void register(String path, BeanPropertyAssocMany<?> many, BeanCollection<?> bc);
|
||||
|
||||
/**
|
||||
* Use soft-references for streaming queries, so unreachable entries can be garbage collected.
|
||||
*/
|
||||
void useReferences(boolean useReferences);
|
||||
|
||||
/**
|
||||
* Return true to include a many as a secondary query for unmodified.
|
||||
*/
|
||||
|
||||
@@ -615,6 +615,24 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
return type == PersistRequest.Type.INSERT ? batchEscalateOnCascadeInsert : batchEscalateOnCascadeDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void freeze(EntityBean entityBean) {
|
||||
if (entityBean._ebean_getIntercept().freeze()) {
|
||||
// recursively freeze the graph for this entityBean
|
||||
for (BeanProperty beanProperty : propertiesMutable) {
|
||||
beanProperty.freeze(entityBean);
|
||||
}
|
||||
for (BeanPropertyAssocOne<?> one : propertiesOne) {
|
||||
|
||||
|
||||
one.freeze(entityBean);
|
||||
}
|
||||
for (BeanPropertyAssocMany<?> many : propertiesMany) {
|
||||
many.freeze(entityBean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void metricPersistBatch(PersistRequest.Type type, long startNanos, int size) {
|
||||
iudMetrics.addBatch(type, startNanos, size);
|
||||
}
|
||||
|
||||
@@ -142,6 +142,14 @@ public final class DLoadContext implements LoadContext {
|
||||
ElPropertyValue elGetValue = rootDescriptor.elGetValue(props.getPath());
|
||||
boolean many = elGetValue.beanProperty().containsMany();
|
||||
registerSecondaryNode(many, props);
|
||||
if (many && secondaryProperties != null) {
|
||||
secondaryProperties.add(elGetValue.beanProperty());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean includeSecondary(BeanPropertyAssocMany<?> many) {
|
||||
return secondaryProperties != null && secondaryProperties.contains(many);
|
||||
}
|
||||
|
||||
boolean isBeanCacheGet() {
|
||||
|
||||
Reference in New Issue
Block a user