#2233 Fix with setter on ToMany now not invoking lazy loading

- ebean-agent changed to not invoke preGetter on ToMany (just like Id)
- EntityBeanIntercept preSetterMany() changed to ensure loading flag set
This commit is contained in:
rbygrave
2021-05-21 08:48:42 +12:00
parent 77c6f1cb9f
commit 79740accfa
5 changed files with 12 additions and 6 deletions
@@ -85,6 +85,8 @@ public final class EntityBeanIntercept implements Serializable {
*/
private static final byte FLAG_CHANGED_PROP = 2;
private static final byte FLAG_CHANGEDLOADED_PROP = 3;
/**
* Flags indicating if a property is a dirty embedded bean. Used to distinguish
* between an embedded bean being completely overwritten and one of its
@@ -569,6 +571,10 @@ public final class EntityBeanIntercept implements Serializable {
flags[propertyIndex] |= FLAG_CHANGED_PROP;
}
private void setChangeLoaded(int propertyIndex) {
flags[propertyIndex] |= FLAG_CHANGEDLOADED_PROP;
}
/**
* Set that an embedded bean has had one of its properties changed.
*/
@@ -937,7 +943,7 @@ public final class EntityBeanIntercept implements Serializable {
if (readOnly) {
throw new IllegalStateException("This bean is readOnly");
}
setChangedProperty(propertyIndex);
setChangeLoaded(propertyIndex);
}
}
+2 -2
View File
@@ -18,8 +18,8 @@
<ebean-migration.version>12.4.0</ebean-migration.version>
<ebean-test-docker.version>4.1</ebean-test-docker.version>
<ebean-datasource.version>7.0</ebean-datasource.version>
<ebean-agent.version>12.8.2</ebean-agent.version>
<ebean-maven-plugin.version>12.8.2</ebean-maven-plugin.version>
<ebean-agent.version>12.8.4</ebean-agent.version>
<ebean-maven-plugin.version>12.8.4</ebean-maven-plugin.version>
</properties>
<dependencyManagement>
+1 -1
View File
@@ -302,7 +302,7 @@
<plugin>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>12.8.2</version>
<version>12.8.4</version>
<executions>
<execution>
<id>test</id>
+1 -1
View File
@@ -76,7 +76,7 @@
<plugin>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>12.8.2</version>
<version>12.8.4</version>
<executions>
<execution>
<id>test</id>
+1 -1
View File
@@ -146,7 +146,7 @@
<plugin>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>12.8.2</version>
<version>12.8.4</version>
<executions>
<execution>
<id>test</id>