Red Hat Web Application Framework 6.1 Manuale Utente Pagina 98

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 230
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 97
84 Chapter 9. Persistence Tutorial
select article_id
from authors, author_article_map
where authors.author_id = author_article_map.author_id
and lower(last_name) like :lastName || ’%’
} map {
authorID = authors.author_id;
}
}
query retrieveSelectedArticles {
BigDecimal articleID;
String title;
do {
select article_id, title from articles
} map {
articleID = articles.article_id;
title = articles.title;
}
}
Next, simply retrieve one query and add the other query as part of the filter, as follows (remove the \
and make it all one line):
Session session = SessionManager.getSession();
DataQuery query = \
session.retrieveQuery("tutorial.retrieveSelectedArticles");
Filter filter = query.addInSubqueryFilter("articleID", \
"tutorial.retrieveAuthorsWithParam");
// we have to set the value for "lastName" since it is a bind variable
// in the subquery we added.
filter.set("lastName", "b");
System.out.println\
("The following articles have at least one author whose " +
"last name starts with ’b’");
while (query.next()) {
System.out.println(query.get("title"));
}
The code above will actually execute the following SQL:
select article_id, title from articles
where article_id in (select article_id
from authors, author_article_map
where authors.author_id = \
author_article_map.author_id
and lower(last_name) like ? || ’%’
with ? = "b"
Note
While there are other, possibly better ways to obtain the same result, this example is used to demon-
strate how the feature works, not as an authoritative example of writing queries.
Vedere la pagina 97
1 2 ... 93 94 95 96 97 98 99 100 101 102 103 ... 229 230

Commenti su questo manuale

Nessun commento

Gembird MHP-EP-001-W manuali

Manuali dei proprietari e guide per l'utente per Cuffie Gembird MHP-EP-001-W.
We fornisce 1 manuali pdf Gembird MHP-EP-001-W per scaricare gratuitamente in base al tipo di documento: Scheda Tecnica


Gembird MHP-EP-001-W Scheda Tecnica (1 pagine)


Marchio: Gembird | Categoria: Headphones | Dimensione: 0.16 MB |

 

Indice





Più prodotti e manuali per Cuffie Gembird

Modelli Tipo di Documento
A4-GHCR-170R Scheda Tecnica   Gembird A4-GHCR-170R headphone, 1 pagine
BHP-001 Manuale Utente   Gembird BHP-001 User Manual, 13 pagine
AP-880-5.1 Manuale Utente    Gembird AP-880-5.1 Manuel d'utilisation, 10 pagine
BHP-002 Manuale Utente   Gembird BHP-002 User Manual, 14 pagine
AP-830 Manuale Utente    Gembird AP-830 Manuel d'utilisation, 9 pagine
AP-860 Manuale Utente    Gembird AP-860 Manuel d'utilisation, 9 pagine
BHP-KBP-B Manuale Utente      Gembird BHP-KBP-B User Manual, 14 pagine
BHP-BER-BK Manuale Utente      Gembird BHP-BER-BK User Manual, 12 pagine
MHS-123 Manuale Utente      Gembird MHS-123 User Manual, 8 pagine
MHS-108 Manuale Utente    Gembird MHS-108 Manuel d'utilisation, 9 pagine
WHS-104 Manuale Utente    Gembird WHS-104 Benutzerhandbuch, 12 pagine