Package org.hibernate.search.jpa.impl
Class FullTextEntityManagerImpl
java.lang.Object
org.hibernate.search.jpa.impl.FullTextEntityManagerImpl
- All Implemented Interfaces:
Serializable,javax.persistence.EntityManager,FullTextEntityManager
public class FullTextEntityManagerImpl
extends Object
implements FullTextEntityManager, Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclose()booleancreateFullTextQuery(Query luceneQuery, Class<?>... entities) Create a fulltext query on top of a native Lucene query returning the matching objects of typeentitiesand their respective subclasses.createIndexer(Class<?>... types) Creates a MassIndexer to rebuild the indexes of some or all indexed entity types.createNamedQuery(String name) <T> javax.persistence.TypedQuery<T> createNamedQuery(String name, Class<T> resultClass) createNativeQuery(String sqlString) createNativeQuery(String sqlString, Class resultClass) createNativeQuery(String sqlString, String resultSetMapping) createQuery(String ejbqlString) <T> javax.persistence.TypedQuery<T> createQuery(String qlString, Class<T> resultClass) <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery) void<T> T<T> T<T> Tfind(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType) <T> Tfind(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType, Map<String, Object> hints) voidflush()voidFlush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.getLockMode(Object entity) <T> TgetReference(Class<T> entityClass, Object primaryKey) <T> voidindex(T entity) Force the (re)indexing of a given managed object.booleanisOpen()voidvoidlock(Object entity, javax.persistence.LockModeType lockMode) void<T> Tmerge(T entity) void<T> voidpurge(Class<T> entityType, Serializable id) Remove the entity with the typeentityTypeand the identifieridfrom the index.<T> voidRemove all entities from of particular class and all its subclasses from the index.voidvoidvoidrefresh(Object entity, javax.persistence.LockModeType lockModeType) voidvoidvoidsetFlushMode(javax.persistence.FlushModeType flushMode) voidsetProperty(String key, Object value) <T> T
-
Constructor Details
-
FullTextEntityManagerImpl
-
-
Method Details
-
createFullTextQuery
Description copied from interface:FullTextEntityManagerCreate a fulltext query on top of a native Lucene query returning the matching objects of typeentitiesand their respective subclasses.- Specified by:
createFullTextQueryin interfaceFullTextEntityManager- Parameters:
luceneQuery- The native Lucene query to be rn against the Lucene index.entities- List of classes for type filtering. The query result will only return entities of the specified types and their respective subtype. If no class is specified no type filtering will take place.- Returns:
- A
FullTextQuerywrapping around the native Lucene wuery.
-
index
public <T> void index(T entity) Description copied from interface:FullTextEntityManagerForce the (re)indexing of a given managed object. Indexation is batched per transaction: if a transaction is active, the operation will not affect the index at least until commit.- Specified by:
indexin interfaceFullTextEntityManager- Parameters:
entity- The entity to index - must not benull.
-
getSearchFactory
- Specified by:
getSearchFactoryin interfaceFullTextEntityManager- Returns:
- the
SearchFactoryinstance.
-
purge
Description copied from interface:FullTextEntityManagerRemove the entity with the typeentityTypeand the identifieridfrom the index. Ifid == nullall indexed entities of this type and its indexed subclasses are deleted. In this case this method behaves likeFullTextEntityManager.purgeAll(Class).- Specified by:
purgein interfaceFullTextEntityManager- Parameters:
entityType- The type of the entity to delete.id- The id of the entity to delete.
-
purgeAll
Description copied from interface:FullTextEntityManagerRemove all entities from of particular class and all its subclasses from the index.- Specified by:
purgeAllin interfaceFullTextEntityManager- Parameters:
entityType- The class of the entities to remove.
-
flushToIndexes
public void flushToIndexes()Description copied from interface:FullTextEntityManagerFlush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.- Specified by:
flushToIndexesin interfaceFullTextEntityManager
-
persist
- Specified by:
persistin interfacejavax.persistence.EntityManager
-
merge
public <T> T merge(T entity) - Specified by:
mergein interfacejavax.persistence.EntityManager
-
remove
- Specified by:
removein interfacejavax.persistence.EntityManager
-
find
- Specified by:
findin interfacejavax.persistence.EntityManager
-
find
- Specified by:
findin interfacejavax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType) - Specified by:
findin interfacejavax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType, Map<String, Object> hints) - Specified by:
findin interfacejavax.persistence.EntityManager
-
getReference
- Specified by:
getReferencein interfacejavax.persistence.EntityManager
-
flush
public void flush()- Specified by:
flushin interfacejavax.persistence.EntityManager
-
setFlushMode
- Specified by:
setFlushModein interfacejavax.persistence.EntityManager
-
getFlushMode
- Specified by:
getFlushModein interfacejavax.persistence.EntityManager
-
lock
- Specified by:
lockin interfacejavax.persistence.EntityManager
-
lock
public void lock(Object entity, javax.persistence.LockModeType lockModeType, Map<String, Object> hints) - Specified by:
lockin interfacejavax.persistence.EntityManager
-
refresh
- Specified by:
refreshin interfacejavax.persistence.EntityManager
-
refresh
- Specified by:
refreshin interfacejavax.persistence.EntityManager
-
refresh
- Specified by:
refreshin interfacejavax.persistence.EntityManager
-
refresh
public void refresh(Object entity, javax.persistence.LockModeType lockModeType, Map<String, Object> hints) - Specified by:
refreshin interfacejavax.persistence.EntityManager
-
clear
public void clear()- Specified by:
clearin interfacejavax.persistence.EntityManager
-
detach
- Specified by:
detachin interfacejavax.persistence.EntityManager
-
contains
- Specified by:
containsin interfacejavax.persistence.EntityManager
-
getLockMode
- Specified by:
getLockModein interfacejavax.persistence.EntityManager
-
setProperty
- Specified by:
setPropertyin interfacejavax.persistence.EntityManager
-
getProperties
- Specified by:
getPropertiesin interfacejavax.persistence.EntityManager
-
createQuery
- Specified by:
createQueryin interfacejavax.persistence.EntityManager
-
createQuery
public <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery) - Specified by:
createQueryin interfacejavax.persistence.EntityManager
-
createQuery
- Specified by:
createQueryin interfacejavax.persistence.EntityManager
-
createNamedQuery
- Specified by:
createNamedQueryin interfacejavax.persistence.EntityManager
-
createNamedQuery
- Specified by:
createNamedQueryin interfacejavax.persistence.EntityManager
-
createNativeQuery
- Specified by:
createNativeQueryin interfacejavax.persistence.EntityManager
-
createNativeQuery
- Specified by:
createNativeQueryin interfacejavax.persistence.EntityManager
-
createNativeQuery
- Specified by:
createNativeQueryin interfacejavax.persistence.EntityManager
-
joinTransaction
public void joinTransaction()- Specified by:
joinTransactionin interfacejavax.persistence.EntityManager
-
unwrap
- Specified by:
unwrapin interfacejavax.persistence.EntityManager
-
getDelegate
- Specified by:
getDelegatein interfacejavax.persistence.EntityManager
-
close
public void close()- Specified by:
closein interfacejavax.persistence.EntityManager
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfacejavax.persistence.EntityManager
-
getTransaction
- Specified by:
getTransactionin interfacejavax.persistence.EntityManager
-
getEntityManagerFactory
- Specified by:
getEntityManagerFactoryin interfacejavax.persistence.EntityManager
-
getCriteriaBuilder
- Specified by:
getCriteriaBuilderin interfacejavax.persistence.EntityManager
-
getMetamodel
- Specified by:
getMetamodelin interfacejavax.persistence.EntityManager
-
createIndexer
Description copied from interface:FullTextEntityManagerCreates a MassIndexer to rebuild the indexes of some or all indexed entity types. Instances cannot be reused.- Specified by:
createIndexerin interfaceFullTextEntityManager- Parameters:
types- optionally restrict the operation to selected types- Returns:
-