
org.hibernate.search.cfg.FieldBridgeDirectMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-search-engine Show documentation
Show all versions of hibernate-search-engine Show documentation
Core of the Object/Lucene mapper, query engine and index management
/*
* 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.util.HashMap;
import java.util.Map;
import org.hibernate.search.bridge.FieldBridge;
/**
* As opposed to FieldBridgeMapping which is used as an option of Field,
* this mapping can be defined directly on the property.
* Mostly used when no Field is defined, such as on DocumentId.
*
* @author Sanne Grinovero (C) 2012 Red Hat Inc.
*/
public class FieldBridgeDirectMapping extends PropertyMapping {
private final Map fieldBridgeAnn = new HashMap();
public FieldBridgeDirectMapping(PropertyDescriptor property, EntityDescriptor entity, SearchMapping mapping, Class extends FieldBridge> fieldBridge) {
super( property, entity, mapping );
this.fieldBridgeAnn.put( "impl", fieldBridge );
property.setFieldBridge( fieldBridgeAnn );
}
public FieldBridgeDirectMapping param(String name, String value) {
Map param = SearchMapping.addElementToAnnotationArray( fieldBridgeAnn, "params" );
param.put( "name", name );
param.put( "value", value );
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy