public interface SearchMapping
Provides entry points to Hibernate Search operations that are not tied to a specific ORM session.
| Modifier and Type | Method and Description |
|---|---|
Collection<? extends SearchIndexedEntity> |
allIndexedEntities() |
Backend |
getBackend(String backendName) |
IndexManager |
getIndexManager(String indexName) |
SearchIndexedEntity |
indexedEntity(Class<?> entityType) |
SearchIndexedEntity |
indexedEntity(String entityName) |
default <T> SearchScope<T> |
scope(Class<T> type)
Create a
SearchScope limited to the given type. |
<T> SearchScope<T> |
scope(Class<T> expectedSuperType,
Collection<String> entityNames)
Create a
SearchScope limited to entity types referenced by their name. |
default <T> SearchScope<T> |
scope(Class<T> expectedSuperType,
String entityName)
Create a
SearchScope limited to entity types referenced by their name. |
<T> SearchScope<T> |
scope(Collection<? extends Class<? extends T>> types)
Create a
SearchScope limited to the given types. |
javax.persistence.EntityManagerFactory |
toEntityManagerFactory() |
SessionFactory |
toOrmSessionFactory() |
default <T> SearchScope<T> scope(Class<T> type)
SearchScope limited to the given type.T - A type to include in the scope.type - A type to include in the scope.SearchScope<T> SearchScope<T> scope(Collection<? extends Class<? extends T>> types)
SearchScope limited to the given types.T - A supertype of all types to include in the scope.types - A collection of types to include in the scope.SearchScopedefault <T> SearchScope<T> scope(Class<T> expectedSuperType, String entityName)
SearchScope limited to entity types referenced by their name.T - A supertype of all entity types to include in the scope.expectedSuperType - A supertype of all entity types to include in the scope.entityName - An entity name. See Entity.name().SearchScope<T> SearchScope<T> scope(Class<T> expectedSuperType, Collection<String> entityNames)
SearchScope limited to entity types referenced by their name.T - A supertype of all entity types to include in the scope.expectedSuperType - A supertype of all entity types to include in the scope.entityNames - A collection of entity names. See Entity.name().SearchScopejavax.persistence.EntityManagerFactory toEntityManagerFactory()
EntityManagerFactory used by this SearchMapping.SessionFactory toOrmSessionFactory()
SessionFactory used by this SearchMapping.SearchIndexedEntity indexedEntity(Class<?> entityType)
entityType - The type of an indexed entity.
This must be the exact type; passing the type of a mapped-superclass for example will not work.SearchIndexedEntity for the indexed entity with the exact given type.SearchException - If the type does not match any indexed entity.SearchIndexedEntity indexedEntity(String entityName)
entityName - The name of an indexed entity. See Entity.name().SearchIndexedEntity for the indexed entity with the given name.SearchException - If the name does not match any indexed entity.Collection<? extends SearchIndexedEntity> allIndexedEntities()
SearchIndexedEntity for each indexed entityIndexManager getIndexManager(String indexName)
indexName - The key to get the required IndexManager instance.indexName as name.Copyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.