Package org.hibernate.search.jpa
Interface FullTextEntityManager
-
- All Superinterfaces:
javax.persistence.EntityManager
- All Known Subinterfaces:
FullTextSession
@Deprecated public interface FullTextEntityManager extends javax.persistence.EntityManager
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager). Refer to the migration guide for more information.Extends an EntityManager with Full-Text operations- Author:
- Emmanuel Bernard
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description FullTextQuerycreateFullTextQuery(Query luceneQuery, Class<?>... entities)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then create aSearchQuerywithSearchSession.search(Class).MassIndexercreateIndexer(Class<?>... types)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), then create a mass indexer withSearchSession.massIndexer(Class[]).voidflushToIndexes()Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then force the immediate execution of indexing operations usingSearchIndexingPlan.execute().SearchFactorygetSearchFactory()Deprecated.See the deprecation note onSearchFactory.<T> voidindex(T entity)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then add/update/remove entities to/from the index usingSearchIndexingPlan.addOrUpdate(Object),SearchIndexingPlan.delete(Object), orSearchIndexingPlan.purge(Class, Object, String).<T> voidpurge(Class<T> entityType, Serializable id)Deprecated.To purge all instances of a given type, see the deprecation note onpurgeAll(Class).<T> voidpurgeAll(Class<T> entityType)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.purge()to purge all indexes in scope.-
Methods inherited from interface javax.persistence.EntityManager
clear, close, contains, createEntityGraph, createEntityGraph, createNamedQuery, createNamedQuery, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, detach, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityGraph, getEntityGraphs, getEntityManagerFactory, getFlushMode, getLockMode, getMetamodel, getProperties, getReference, getTransaction, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, merge, persist, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrap
-
-
-
-
Method Detail
-
createFullTextQuery
@Deprecated FullTextQuery createFullTextQuery(Query luceneQuery, Class<?>... entities)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then create aSearchQuerywithSearchSession.search(Class). If you really need an adapter to Hibernate ORM'sQuerytype, convert thatSearchQueryusingSearch.toOrmQuery(SearchQuery), but be aware that only part of the contract is implemented. Refer to the migration guide for more information.Create a fulltext query on top of a native Lucene query returning the matching objects of typeentitiesand their respective subclasses.- 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. - Throws:
IllegalArgumentException- if entityType isnullor not a class or superclass annotated with@Indexed.
-
index
@Deprecated <T> void index(T entity)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then add/update/remove entities to/from the index usingSearchIndexingPlan.addOrUpdate(Object),SearchIndexingPlan.delete(Object), orSearchIndexingPlan.purge(Class, Object, String).Force 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.- Type Parameters:
T- the type of the entity to index- Parameters:
entity- The entity to index - must not benull.- Throws:
IllegalArgumentException- if entity is null or not an @Indexed entity
-
getSearchFactory
@Deprecated SearchFactory getSearchFactory()
Deprecated.See the deprecation note onSearchFactory.- Returns:
- the
SearchFactoryinstance.
-
purge
@Deprecated <T> void purge(Class<T> entityType, Serializable id)
Deprecated.To purge all instances of a given type, see the deprecation note onpurgeAll(Class). To purge a specific instance, instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then add/update/remove entities to/from the index usingSearchIndexingPlan.addOrUpdate(Object),SearchIndexingPlan.delete(Object), orSearchIndexingPlan.purge(Class, Object, String).Remove 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 likepurgeAll(Class).- Type Parameters:
T- the type of the entity to purge- Parameters:
entityType- The type of the entity to delete.id- The id of the entity to delete.- Throws:
IllegalArgumentException- if entityType isnullor not a class or superclass annotated with@Indexed.
-
purgeAll
@Deprecated <T> void purgeAll(Class<T> entityType)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.purge()to purge all indexes in scope.Remove all entities from of particular class and all its subclasses from the index.- Type Parameters:
T- the type of the entity to purge- Parameters:
entityType- The class of the entities to remove.- Throws:
IllegalArgumentException- if entityType isnullor not a class or superclass annotated with@Indexed.
-
flushToIndexes
@Deprecated void flushToIndexes()
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then force the immediate execution of indexing operations usingSearchIndexingPlan.execute().Flush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.
-
createIndexer
@Deprecated MassIndexer createIndexer(Class<?>... types)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), then create a mass indexer withSearchSession.massIndexer(Class[]). Refer to the migration guide for more information.Creates a MassIndexer to rebuild the indexes of some or all indexed entity types. Instances cannot be reused.- Parameters:
types- optionally restrict the operation to selected types- Returns:
- a new MassIndexer
-
-