Copy to ClipboardCopied!Toggle word wrapToggle overflow
Real search screens let the user enter optional search criteria to narrow the list of returned results. The Query object lets you specify optional restrictions to support this usecase:
<component name="examplePerson" class="Person"/>
<framework:entity-query name="people" ejbql="select p from Person p"
order="lastName" max-results="20">
<framework:restrictions>
<value>
lower(firstName) like lower(concat(#{examplePerson.firstName},'%&'))
</value>
<value>
lower(lastName) like lower(concat(#{examplePerson.lastName},'%&'))
</value>
</framework:restrictions>
</framework:entity-query>
<component name="examplePerson" class="Person"/>
<framework:entity-query name="people" ejbql="select p from Person p"
order="lastName" max-results="20">
<framework:restrictions>
<value>
lower(firstName) like lower(concat(#{examplePerson.firstName},'%&'))
</value>
<value>
lower(lastName) like lower(concat(#{examplePerson.lastName},'%&'))
</value>
</framework:restrictions>
</framework:entity-query>
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Unfortunately, Query objects do not work well with join fetch queries. We do not recommend using pagination with these queries. You will need to implement your own method of total result number calculation by overriding getCountEjbql().
All of the examples in this section have shown re-use via configuration. It is equally possibly to re-use via extension:
Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.
Rendiamo l’open source più inclusivo
Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.
Informazioni su Red Hat
Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.