Liferay 7.2 Finder不满意的参考

问题描述

我有Liferay 7.2

我创建了一个模块服务“ blogentriesfinderservice”。

我使用服务生成器来创建实体。

现在我想要一个自定义查询

我创建了FooFinderImpl,但在liferay中却出现此错误

Bundle {id: 4459,name: blogentriesfinderservice.service,version: 1.0.0}
    Declarative Service {id: 4932,name: blogentriesfinderservice.service.impl.FooLocalServiceImpl,unsatisfied references: 
        {name: fooFinder,target: null}
    }
    Declarative Service {id: 4933,name: blogentriesfinderservice.service.impl.FooServiceImpl,target: null}
        {name: fooLocalService,target: null}
    }

这是FooFinderImpl的代码

package blogentriesfinderservice.service.persistence.impl;

import java.util.List;

import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl;


import blogentriesfinderservice.model.Foo;
import blogentriesfinderservice.model.impl.FooImpl;
import blogentriesfinderservice.service.persistence.FooFinder;

import com.liferay.portal.dao.orm.custom.sql.CustomsqlUtil;
import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.sqlQuery;

public class FooFinderImpl extends FooFinderBaseImpl implements FooFinder  {

    
    public String findByDentroFinder() {

         return "test";
    }
    
    
}

解决方法

我找到了解决方法。

我需要在类声明之前添加以下代码:

@Component(
        service = FooFinder.class
)