Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HSEARCH-168 Add application level filter
- Loading branch information
1 parent
b8c10ca
commit b431e14
Showing
8 changed files
with
134 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...orm/automaticindexing/filter/impl/HibernateOrmApplicationAutomaticIndexingTypeFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.mapper.orm.automaticindexing.filter.impl; | ||
|
||
import org.hibernate.search.mapper.orm.mapping.impl.HibernateOrmMapping; | ||
import org.hibernate.search.mapper.pojo.automaticindexing.filter.PojoAutomaticIndexingTypeFilterConfigurer; | ||
import org.hibernate.search.mapper.pojo.automaticindexing.filter.spi.PojoAutomaticIndexingTypeFilterHolder; | ||
|
||
public final class HibernateOrmApplicationAutomaticIndexingTypeFilter { | ||
|
||
private static final PojoAutomaticIndexingTypeFilterHolder INDEXING_TYPE_FILTER_HOLDER = new PojoAutomaticIndexingTypeFilterHolder(); | ||
private static final PojoAutomaticIndexingTypeFilterHolder INCLUDE_ALL_INDEXING_TYPE_FILTER_HOLDER = new PojoAutomaticIndexingTypeFilterHolder(); | ||
|
||
private HibernateOrmApplicationAutomaticIndexingTypeFilter() { | ||
} | ||
|
||
public static void configureFilter(HibernateOrmMapping mapping, | ||
PojoAutomaticIndexingTypeFilterConfigurer configurer) { | ||
|
||
HibernateOrmAutomaticIndexingTypeFilterContext context = new HibernateOrmAutomaticIndexingTypeFilterContext( | ||
mapping.typeContextProvider() ); | ||
configurer.configure( context ); | ||
INDEXING_TYPE_FILTER_HOLDER.filter( context.createFilter( INCLUDE_ALL_INDEXING_TYPE_FILTER_HOLDER ) ); | ||
} | ||
|
||
public static PojoAutomaticIndexingTypeFilterHolder applicationFilter() { | ||
return INDEXING_TYPE_FILTER_HOLDER; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters