0

我想使用@NamedQueries注释运行多个查询,但它给出的错误是:

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 ")
})

我需要在某处定义这个注释吗?

4

1 回答 1

0

也许是进口声明?

import javax.persistence.*;

另外,您当然需要在您的库中实现 JPA。

于 2013-05-07T06:29:02.640 回答