0
我有如下聲明一個存儲過程:春數據和存儲過程
CREATE PROCEDURE GetAttributesForCategory(IN catId BIGINT(20))
在我春天引導 -backed應用程序有一個實體:
@Entity
@NamedStoredProcedureQueries({
@NamedStoredProcedureQuery(
name = "ProductAttribute.getAttributesForCategory",
procedureName = "GetAttributesForCategory",
parameters = {
@StoredProcedureParameter(name = "catId",
type = Long.class,
mode = ParameterMode.IN)
}
)
})
public class ProductAttribute {
...
}
和記者資料庫看起來像:
public interface ProductAttributeReposirory extends JpaRepository<ProductAttribute, Long> {
@Procedure(name = "getAttributesForCategory")
List<ProductAttribute> getAttributesForCategory(@Param("catId") Long catId);
}
所有是根據t Øthis example,但Spring上下文加載過程中發生了異常:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'productAttributeRepository': Invocation of init method failed;
nested exception is org.springframework.data.mapping.PropertyReferenceException:
No property getAttributesForCategory found for type ProductAttribute!
我不能想象什麼不順心。任何人都可以?