Pregunta

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 ?

¿Fue útil?

Solución

Maybe an import statement?

import javax.persistence.*;

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top