|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.trg.search.BaseSearchProcessor
com.trg.search.jpa.JPASearchProcessor
public class JPASearchProcessor
Implementation of BaseSearchProcessor that works with JPA.
This class is designed to be used as a singleton. The constructor requires a MetadataUtil instance. Each MetadataUtil instance is typically associated with a single persistence unit (i.e. EntityManagerFactory). A JPASearchProcessor can only be used with EntityManagers that are associated with the same persistence unit as the MetadataUtil. If an application has multiple persistence units, it will need to have multiple corresponding Search Processors.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.trg.search.BaseSearchProcessor |
|---|
BaseSearchProcessor.AliasNode, BaseSearchProcessor.SearchContext |
| Field Summary |
|---|
| Fields inherited from class com.trg.search.BaseSearchProcessor |
|---|
INJECTION_CHECK, metadataUtil, qlType, QLTYPE_EQL, QLTYPE_HQL, ROOT_PATH, rootAlias |
| Constructor Summary | |
|---|---|
JPASearchProcessor(MetadataUtil mdu)
|
|
| Method Summary | |
|---|---|
int |
count(javax.persistence.EntityManager entityManager,
java.lang.Class<?> searchClass,
ISearch search)
Returns the total number of results that would be returned using the given ISearch if there were no paging or maxResult limits. |
int |
count(javax.persistence.EntityManager entityManager,
ISearch search)
Returns the total number of results that would be returned using the given ISearch if there were no paging or maxResult limits. |
java.util.List |
search(javax.persistence.EntityManager entityManager,
java.lang.Class<?> searchClass,
ISearch search)
Search for objects based on the search parameters in the specified ISearch object. |
java.util.List |
search(javax.persistence.EntityManager entityManager,
ISearch search)
Search for objects based on the search parameters in the specified ISearch object. |
SearchResult |
searchAndCount(javax.persistence.EntityManager entityManager,
java.lang.Class<?> searchClass,
ISearch search)
Returns a SearchResult object that includes the list of
results like search() and the total length like
searchLength. |
SearchResult |
searchAndCount(javax.persistence.EntityManager entityManager,
ISearch search)
Returns a SearchResult object that includes the list of
results like search() and the total length like
searchLength. |
java.lang.Object |
searchUnique(javax.persistence.EntityManager entityManager,
java.lang.Class<?> entityClass,
ISearch search)
Search for a single result using the given parameters. |
java.lang.Object |
searchUnique(javax.persistence.EntityManager entityManager,
ISearch search)
Search for a single result using the given parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JPASearchProcessor(MetadataUtil mdu)
| Method Detail |
|---|
public java.util.List search(javax.persistence.EntityManager entityManager,
ISearch search)
ISearch object.
ISearch
public java.util.List search(javax.persistence.EntityManager entityManager,
java.lang.Class<?> searchClass,
ISearch search)
ISearch object. Uses the specified searchClass, ignoring the
searchClass specified on the search itself.
ISearch
public int count(javax.persistence.EntityManager entityManager,
ISearch search)
ISearch if there were no paging or maxResult limits.
ISearch
public int count(javax.persistence.EntityManager entityManager,
java.lang.Class<?> searchClass,
ISearch search)
ISearch if there were no paging or maxResult limits.
Uses the specified searchClass, ignoring the searchClass specified on the
search itself.
ISearch
public SearchResult searchAndCount(javax.persistence.EntityManager entityManager,
ISearch search)
SearchResult object that includes the list of
results like search() and the total length like
searchLength.
ISearch
public SearchResult searchAndCount(javax.persistence.EntityManager entityManager,
java.lang.Class<?> searchClass,
ISearch search)
SearchResult object that includes the list of
results like search() and the total length like
searchLength. Uses the specified searchClass, ignoring the
searchClass specified on the search itself.
ISearch
public java.lang.Object searchUnique(javax.persistence.EntityManager entityManager,
ISearch search)
throws javax.persistence.NonUniqueResultException
javax.persistence.NonUniqueResultException
public java.lang.Object searchUnique(javax.persistence.EntityManager entityManager,
java.lang.Class<?> entityClass,
ISearch search)
throws javax.persistence.NonUniqueResultException
javax.persistence.NonUniqueResultException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||