java - 如何不允许管理员创建 ProductImpl 的产品实例

标签 java broadleaf-commerce

基本上,我编写了两个代表产品的类(从 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/

相关文章:

java - Broadleaf 未使用 Java > 8 构建或启动 : Unable to start embedded Tomcat

mysql - 阔叶 : moving to mysql - getting error

java - 使用 java 从本地主机在远程 hdfs 上创建目录

Java:无法访问外部文件

java - 如何使用 JSoup 从 HTML a 元素中选择具有特定文本的元素

java - 通过命令行管理 Tomcat 中的 Web 应用程序

java - 关于 BroadLeaf Commerce 管理中的 GWT

java - 内部类可以访问但不能更新值 - AsyncTask

java - 阔叶 : No bean named 'blMainEntityActionsExtensionManager' is defined

java - Rest API - Broadleaf Commerce 中的 NullPointerException