基本上,我编写了两个代表产品的类(从 org.broadleafcommerce 扩展 ProductImpl...)并将其添加到需要的所有配置中。
现在,当我单击管理站点模式窗口上的“添加产品”按钮时,会显示一个列表,其中包括产品、ProductBundle、MyProduct1、MyProduct2。
我想从该列表中删除 Product 和 ProductBundle(来自 org.broadleafcommerce 的类..)。
这可能吗?我使用的是 4.0.12 版本。
最佳答案
是的,有可能,您可以通过为扩展类设置以下 AdminPresentation
注释来控制:
@AdminPresentationClass(ceilingDisplayEntity = "com.mycompany.demo.domain.MyProduct")
ceilingDisplayEntity
上的 javadoc 说:
By specifying a class lower in the inheritance hierarchy, you can cause only a subset of the entire JPA inheritance hierarchy to be presented to the user as options when creating new entities. This value will override any previous settings for this inheritance hierarchy
关于java - 如何不允许管理员创建 ProductImpl 的产品实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39485124/