请问如何在实体里定义一个计算字段并和数据库字段映射

想在实体定义a,b,c三个属性对应数据库里的A,B,C三个字段,而C=A+B,不知道CUBA的实体是否支持这种计算字段和属性

不能通过声明的方式定义这种属性。 可以通过以下方式处理 C的计算:

  1. 使用实体事件,参考:https://doc.cuba-platform.cn/manual-7.2-chs/entityChangedEvent.html
  2. 在UI 中使用数据窗口的事件,参考: https://doc.cuba-platform.cn/manual-7.2-chs/gui_instance_container.html#gui_instance_container_events

好的,谢谢!