All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.search.query.dsl.QueryContextBuilder Maven / Gradle / Ivy

Go to download

Helper to migrate from Hibernate Search 5 to 6, providing partial support for Hibernate Search 5 Engine APIs on top of Hibernate Search 6

The newest version!
/*
 * SPDX-License-Identifier: Apache-2.0
 * Copyright Red Hat Inc. and Hibernate Authors
 */

package org.hibernate.search.query.dsl;

/**
 * Query builder that needs contextualization:
 * A query builder should know which entity or analyzer it relies on.
 *
 * 
 * QueryBuilder builder =
 * searchFactory.buildQueryBuilder()
 *   .forEntity(Customer.class)
 *     .overridesForField("profession", "acronym-analyzer")
 *     .get();
 * 
 *
 * overridesForField is optional (and usually not needed). This method overrides the
 * underlying analyzer (for a given field) used to build queries.
 *
 * @author Emmanuel Bernard
 * @deprecated See the deprecation note on {@link QueryBuilder}.
 */
@Deprecated
public interface QueryContextBuilder {
	//TODO make a forEntities

	/**
	 * Creates an entity context which can be used to obtain a {@link QueryBuilder}.
	 * 

* Note that the passed entity type is used to verify field names, transparently apply analyzers and field bridges * etc. The query result list, however, is not automatically restricted to the given type. Instead a type filter * must be applied when creating the full text query in order to restrict the query result to certain entity types. * * @param entityType entity type used for meta data retrieval during query creation * @return an entity context */ EntityContext forEntity(Class entityType); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy