#2766 - Explicitly specify disableLazyLoad on beans created from JSON (default)

- Beans created from JSON default to disableLazyLoad true
- Explicitly use new JsonReadOptions().setEnableLazyLoading(true) when lazy loading is needed
This commit is contained in:
Rob Bygrave
2022-08-01 15:43:08 +12:00
parent 54cbdae22d
commit ed830aeb0c
2 changed files with 8 additions and 1 deletions
@@ -1,5 +1,6 @@
package org.tests.text.json;
import io.ebean.text.json.JsonReadOptions;
import io.ebean.xtest.BaseTestCase;
import io.ebean.BeanState;
import io.ebean.DB;
@@ -54,7 +55,7 @@ public class TestTextJsonReferenceBean extends BaseTestCase {
String jsonString = jsonContext.toJson(product);
Product refProd = jsonContext.toBean(Product.class, jsonString);
Product refProd = jsonContext.toBean(Product.class, jsonString, new JsonReadOptions().setEnableLazyLoading(true));
BeanDescriptor<Product> prodDesc = server.descriptor(Product.class);
EntityBean eb = (EntityBean) refProd;