Вопрос

I want to run multiple queries using @NamedQueries annotation but it is giving error that :

1. The attribute value is undefined for the annotation typed NamedQueries
2.NamedQueries can not be resolved to a type

Following is the code:

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

Do i need to define this annotation somewhere ?

Это было полезно?

Решение

Maybe an import statement?

import javax.persistence.*;

Plus of course you need the JPA implementation among your libraries.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top