ServiceBuilder 未创建 FinderImpl class?

ServiceBuilder not creating FinderImpl class?

我使用 Liferay 7 创建了一些服务。但是 FinderImplFinderUtil 类 不是在构建 services.The 之后创建的,我遵循的步骤如下:

  1. 创建了一个服务生成器项目。
  2. 已创建查找器列。
  3. 构建并部署了 *-api 和 *-service...其中 * 是 project/service 名称。
  4. 使用 gradle ->Refresh Gradle Project 刷新项目。
  5. 将 *-service 和 *-api 拖放到 运行 服务器上。

结果:它创建了 table 但 *FinderImpl 和 *FinderUtil 类 不在项目中。

您必须创建 *FinderImpl class 并重建服务,因为默认情况下不会创建 Finder classes。根据 Liferay 文档:

The first step is to create a *FinderImpl class in the service persistence package. For the Guestbook application, for example, you could create a EntryFinderImpl class in the com.liferay.docs.guestbook.service.persistence.impl package. Your class should extend BasePersistenceImpl<Entry>.

Run Service Builder to generate the *Finder interface and the *Util class for the finder. Service Builder generates the *Finder interface and the *FinderUtil utility class based on the *FinderImpl class. Modify your *FinderImpl class to have it implement the *Finder interface you just generated:

来源:https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/custom-sql