org.hibernate.search.cfg.ProvidedIdMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-embedded-query
Show all versions of infinispan-embedded-query
Infinispan Embedded Query All-in-One module
The newest version!
/*
* 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 .
*/
package org.hibernate.search.cfg;
import java.lang.annotation.ElementType;
import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.analysis.util.TokenizerFactory;
public class ProvidedIdMapping {
private final SearchMapping searchMapping;
private final Map providedIdMapping;
private EntityDescriptor entity;
public ProvidedIdMapping(SearchMapping searchMapping, EntityDescriptor entity) {
this.searchMapping = searchMapping;
this.entity = entity;
providedIdMapping = new HashMap();
entity.setProvidedId( providedIdMapping );
}
public ProvidedIdMapping name(String name) {
this.providedIdMapping.put( "name", name );
return this;
}
public FieldBridgeMapping bridge(Class> impl) {
return new FieldBridgeMapping( impl, providedIdMapping, null, null, entity, searchMapping );
}
public FullTextFilterDefMapping fullTextFilterDef(String name, Class> impl) {
return new FullTextFilterDefMapping( searchMapping, name, impl );
}
public PropertyMapping property(String name, ElementType type) {
return new PropertyMapping( name, type, entity, searchMapping );
}
public AnalyzerDefMapping analyzerDef(String name, Class extends TokenizerFactory> tokenizerFactory) {
return analyzerDef( name, "", tokenizerFactory );
}
public AnalyzerDefMapping analyzerDef(String name, String tokenizerName, Class extends TokenizerFactory> tokenizerFactory) {
return new AnalyzerDefMapping( name, tokenizerName, tokenizerFactory, searchMapping );
}
public NormalizerDefMapping normalizerDef(String name) {
return new NormalizerDefMapping( name, searchMapping );
}
public EntityMapping entity(Class> entityType) {
return new EntityMapping( entityType, searchMapping );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy