我在实体编辑页面的控制器中希望使用getEditedEntity()。
import com.alibaba.fastjson.JSON;
String jsonString = JSON.toJSONString(getEditedEntity());
使用时报出以下两个错误。
IllegalStateException: Cannot get unfetched attribute [createTs] from detached object com.test.sysmanager.entity.EcoSys-53d8cc00-dc82-cfa9-354f-ca7aef494bc6 [detached].
Caused by: com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.58, class com.test.sysmanager.entity.EcoSys, method : getCreateTs
于是我自己创建了一个包括系统属性的视图
<view entity="sysmanager_EcoSys"
name="my-view"
extends="_local" systemProperties="true"/>
并在编辑页面里使用了它
<data>
<instance id="ecoSysDc"
class="com.test.sysmanager.entity.EcoSys"
view="my-view">
<loader/>
</instance>
</data>
但是仍然会出现以上的错误