|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.trg.search.jpa.JPASearchFacade
public class JPASearchFacade
JPA implementation of SearchFacade.
The SearchProcessor and EntityManager must be set
in order for the SearchFacade to function. Generally, a single
SearchProcessor will be associated with an instance of JPASearchFacade for
the lifetime of the instance, while a new "current" EntityManager will be
injected as needed. Make sure that any EntityManager that is used is
associated with the same persistence unit (i.e. EntityManagerFactory) as the
SearchProcessor.
| Field Summary | |
|---|---|
protected javax.persistence.EntityManager |
entityManager
|
protected JPASearchProcessor |
processor
|
| Constructor Summary | |
|---|---|
JPASearchFacade()
|
|
| Method Summary | |
|---|---|
int |
count(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(ISearch search)
Returns the total number of results that would be returned using the given ISearch if there were no paging or maxResult limits. |
Filter |
getFilterFromExample(java.lang.Object example)
Generates a search filter from the given example using default options. |
Filter |
getFilterFromExample(java.lang.Object example,
ExampleOptions options)
Generates a search filter from the given example using the specified options. |
java.util.List |
search(java.lang.Class<?> searchClass,
ISearch search)
Search for objects based on the search parameters in the specified ISearch object. |
java.util.List |
search(ISearch search)
Search for objects based on the search parameters in the specified ISearch object. |
SearchResult |
searchAndCount(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(ISearch search)
Returns a SearchResult object that includes the list of
results like search() and the total length like
searchLength. |
java.lang.Object |
searchUnique(java.lang.Class<?> searchClass,
ISearch search)
Search for a single result using the given parameters. |
java.lang.Object |
searchUnique(ISearch search)
Search for a single result using the given parameters. |
void |
setEntityManager(javax.persistence.EntityManager entityManager)
|
void |
setSearchProcessor(JPASearchProcessor searchProcessor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JPASearchProcessor processor
protected javax.persistence.EntityManager entityManager
| Constructor Detail |
|---|
public JPASearchFacade()
| Method Detail |
|---|
public void setSearchProcessor(JPASearchProcessor searchProcessor)
public void setEntityManager(javax.persistence.EntityManager entityManager)
public java.util.List search(ISearch search)
SearchFacadeISearch object.
search in interface SearchFacadeISearch
public java.util.List search(java.lang.Class<?> searchClass,
ISearch search)
SearchFacadeISearch object. Uses the specified searchClass, ignoring the
searchClass specified on the search itself.
search in interface SearchFacadeISearchpublic int count(ISearch search)
SearchFacadeISearch if there were no paging or maxResult limits.
count in interface SearchFacadeISearch
public int count(java.lang.Class<?> searchClass,
ISearch search)
SearchFacadeISearch if there were no paging or maxResult limits.
Uses the specified searchClass, ignoring the searchClass specified on the
search itself.
count in interface SearchFacadeISearchpublic SearchResult searchAndCount(ISearch search)
SearchFacadeSearchResult object that includes the list of
results like search() and the total length like
searchLength.
searchAndCount in interface SearchFacadeISearch
public SearchResult searchAndCount(java.lang.Class<?> searchClass,
ISearch search)
SearchFacadeSearchResult 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.
searchAndCount in interface SearchFacadeISearchpublic java.lang.Object searchUnique(ISearch search)
SearchFacade
searchUnique in interface SearchFacade
public java.lang.Object searchUnique(java.lang.Class<?> searchClass,
ISearch search)
SearchFacade
searchUnique in interface SearchFacadepublic Filter getFilterFromExample(java.lang.Object example)
SearchFacade
getFilterFromExample in interface SearchFacade
public Filter getFilterFromExample(java.lang.Object example,
ExampleOptions options)
SearchFacade
getFilterFromExample in interface SearchFacade
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||