I want to have multiple queries in my entity and I dont know the way to do it, heres an example
@NamedQuery(name="night.lessRecentThan", queryString="select n from Night n where n.date <= :date")
@NamedQuery(name="night.moreRecentThan", queryString="select n from Night n where n.date >= :date")
This gives me an error saying duplicate annotation, but when I drop the second @NamedQuery I get other errors relating to these queries.
So if someone could show me how to use the annotation with multiple queries I would be greatful.
like so:
@NamedQueries({ @NamedQuery(name="night.lessRecentThan", queryString="select n from Night n where n.date <= :date"), @NamedQuery(name="night.moreRecentThan", queryString="select n from Night n where n.date >= :date") })