Jsf 多个JPA查询错误
我想使用Jsf 多个JPA查询错误,jsf,maven,jpa,named-query,Jsf,Maven,Jpa,Named Query,我想使用@namedquerys注释运行多个查询,但给出的错误是: 1. The attribute value is undefined for the annotation typed NamedQueries 2.NamedQueries can not be resolved to a type 代码如下: @NamedQueries({ @NamedQuery(name="findAllBookItems", query = "SELECT i FRO
@namedquerys
注释运行多个查询,但给出的错误是:
1. The attribute value is undefined for the annotation typed NamedQueries
2.NamedQueries can not be resolved to a type
代码如下:
@NamedQueries({
@NamedQuery(name="findAllBookItems",
query = "SELECT i FROM Book i where i.isbn > 1 "),
@NamedQuery(name="findAllCDItems",
query = "SELECT c FROM CD c where c.numberofcds >=0 ")
})
我需要在某个地方定义此注释吗?可能是一条导入语句
import javax.persistence.*;
当然,您还需要在您的库中实现JPA。然后投票决定答案。谢谢通常,如果您使用的是Eclipse,您可以使用Ctrl+Shift+O来“自动”解决这个问题,