java - utilizing JPA Named Queries -
when create entity class database in netbeans, gives me option create named queries persistent fields. accordingly, see these named queries listed @ top of entity class.
what these queries, , how can utilize/"call" them?
i'm aware question more general preferred on so, i'm happy accept link tutorial answers these questions, i've been unable find 1 myself.
see
if have:
@namedquery(name="country.findall", query="select c country c") public class country { ... }
use with:
typedquery<country> query = em.createnamedquery("country.findall",country.class); list<country> results = query.getresultlist();
see also:
Comments
Post a Comment