Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 date 的属性,用户应该能够在创建新实体时输入值:
但是,在编辑现有实体时,日期属性应该是不可编辑的,通过这种方式:
是否有一种简单的方法来声明仅在 OpenXava 实体中创建时可编辑的属性?
是的,只需使用 @ReadOnly(onCreate=false) 注释您的属性:
@ReadOnly(onCreate=false) LocalDate date;
您不需要任何额外的代码。