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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -