我正在 Wildfly 上尝试 DeltaSpike 数据模块,我遵循文档中提到的内容,当我尝试运行具有存储库的 Servlet 时,我在使用存储库时收到 NullPointerException
@Inject
private OrdersRepository orderRep;
List<OrderDto> dao = orderRep.findByRetailer("MyRetail"); // NullPointer
代码
@Repository(forEntity = Order.class)
@MappingConfig(OrderMapper.class)
@EntityManagerConfig(entityManagerResolver = MyDBResolver.class)
public abstract class OrdersRepository extends AbstractEntityRepository<OrderDto, String> {
@Query(named = Order.ORDER_BY_RETAILER, max = 1)
public abstract List<OrderDto> findByRetailer(String retailer);
}
...
我在这里错过了什么吗?