Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

lazy加载异常的BUG #1519

Closed
SpaceDolphinMachineGun opened this issue Oct 9, 2017 · 2 comments
Closed

lazy加载异常的BUG #1519

SpaceDolphinMachineGun opened this issue Oct 9, 2017 · 2 comments
Milestone

Comments

@SpaceDolphinMachineGun
Copy link

@wenshao
之前提过一个 issue是关于序列化lazy数据的,因为后来那个项目废弃了,就一直没有验证,今天重新用到了这个功能,发现还是不行。
经过检查发现FieldSerializer.getPropertyValueDirect方法似乎有些问题:
if (persistenceOneToMany && TypeUtils.isHibernateInitialized(fieldValue)) { return null; }
TypeUtils.isHibernateInitialized返回的是这个value是否已被初始化,如果未被初始化,进行json转换会出lazy异常,这里应该少了个!号。
还有一点,这里只判断了oneToMany的情况,manyToOne情况下还是会抛异常。

wenshao added a commit that referenced this issue Oct 10, 2017
@wenshao
Copy link
Member

wenshao commented Oct 10, 2017

已经修改了,能帮忙验证一下么?

@wenshao wenshao added this to the 1.2.40 milestone Oct 10, 2017
@SpaceDolphinMachineGun
Copy link
Author

感谢 已经没有问题了。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants