Este contenido no está disponible en el idioma seleccionado.
13.42. Query Examples
Note
To return the results use
ksession.getQueryResults("name"), where "name" is the query's name. This returns a list of query results, which allow you to retrieve the objects that matched the query.
- Query for people over the age of 30
query "people over the age of 30" person : Person( age > 30 ) endquery "people over the age of 30" person : Person( age > 30 ) endCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Query for people over the age of X, and who live in Y
query "people over the age of x" (int x, String y) person : Person( age > x, location == y ) endquery "people over the age of x" (int x, String y) person : Person( age > x, location == y ) endCopy to Clipboard Copied! Toggle word wrap Toggle overflow