mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user