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:
Rob Bygrave
2025-04-02 23:07:57 +13:00
parent 314a18f101
commit 162ede4f00
3 changed files with 26 additions and 5 deletions
@@ -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() {