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

org.hibernate.metamodel.mapping.Queryable Maven / Gradle / Ivy

There is a newer version: 7.0.0.Beta1
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * 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.metamodel.mapping;

import java.util.function.Consumer;
import java.util.function.Supplier;

import org.hibernate.boot.spi.SessionFactoryOptions;

/**
 * Defines a mapping model contract for things that can be queried in the HQL,
 * Criteria, etc sense.  Generally this
 *
 * todo (6.0) : consider whether collections are Queryable
 * 		- depends how we envision Queryable being used.  E.g. does it make
 * 		sense to allow calls like `findSubPart( "index" )` or `findSubPart( "element" )`?
 *
 * @author Steve Ebersole
 */
public interface Queryable extends ModelPart {
	/**
	 * For an entity, this form allows for Hibernate's "implicit treat" support -
	 * meaning it should find a sub-part whether defined on the entity, its
	 * super-type or even one of its sub-types.
	 *
	 * @implNote Logically the implementation should consider
	 * {@link org.hibernate.jpa.spi.JpaCompliance}.  Not passed in because it
	 * is expected that implementors have access to the SessionFactory to access
	 * the JpaCompliance.  See {@link SessionFactoryOptions#getJpaCompliance}
	 */
	ModelPart findSubPart(String name, EntityMappingType treatTargetType);

	/**
	 * Like {@link #findSubPart}, this form visits all parts defined on the
	 * entity, its super-types and its sub-types.
	 */
	void visitSubParts(Consumer consumer, EntityMappingType treatTargetType);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy