Top Fields Constructors Methods
org.hibernate.query.results

public Class ResultSetMappingImpl

extends Object
implements ResultSetMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.query.results.ResultSetMapping, org.hibernate.sql.results.jdbc.spi.JdbcValuesMappingProducer
Annotations
@Incubating
@Internal
Imports
java.util.ArrayList, .Collections, .HashMap, .List, .Map, .Objects, .Set, .TreeSet, java.util.function.BiConsumer, .Consumer, org.hibernate.Incubating, .Internal, org.hibernate.engine.spi.LoadQueryInfluencers, .SessionFactoryImplementor, org.hibernate.internal.util.StringHelper, org.hibernate.loader.NonUniqueDiscoveredSqlAliasException, org.hibernate.metamodel.mapping.BasicValuedMapping, org.hibernate.persister.entity.AbstractEntityPersister, .EntityPersister, org.hibernate.query.named.NamedResultSetMappingMemento, org.hibernate.query.results.dynamic.DynamicFetchBuilderLegacy, org.hibernate.sql.ast.spi.SqlSelection, org.hibernate.sql.results.graph.DomainResult, org.hibernate.sql.results.graph.basic.BasicResult, org.hibernate.sql.results.graph.entity.EntityResult, org.hibernate.sql.results.jdbc.spi.JdbcValuesMapping, .JdbcValuesMappingProducer, .JdbcValuesMetadata, org.hibernate.type.BasicType

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final boolean
private Map<String, Map<String, DynamicFetchBuilderLegacy>>
private final String
private List<ResultBuilder>

Constructor Summary

AccessConstructor and Description
public
ResultSetMappingImpl(String mappingIdentifier)

public
ResultSetMappingImpl(String mappingIdentifier, boolean isDynamic)

private

Method Summary

Modifier and TypeMethod and Description
public void
private static void
addColumn(Set<String> aliases, Set<String> knownDuplicateAliases, String column)

private static void
addColumns(Set<String> aliases, Set<String> knownDuplicateAliases, String[] columns)

public void
public void
public JdbcValuesMappingProducer
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public String
public int
getNumberOfResultBuilders()

Implements org.hibernate.query.results.ResultSetMapping.getNumberOfResultBuilders.

The number of result builders currently associated with this mapping
public List<ResultBuilder>
getResultBuilders()

Implements org.hibernate.query.results.ResultSetMapping.getResultBuilders.

The result builders currently associated with this mapping
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
isDynamic()

Implements org.hibernate.query.results.ResultSetMapping.isDynamic.

Indicates whether the mapping is dynamic per ResultSetMapping
private DomainResult<?>
makeImplicitDomainResult(int valuesArrayPosition, Consumer<SqlSelection> sqlSelectionConsumer, JdbcValuesMetadata jdbcResultsMetadata, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public JdbcValuesMapping
resolve(JdbcValuesMetadata jdbcResultsMetadata, LoadQueryInfluencers loadQueryInfluencers, SessionFactoryImplementor sessionFactory)

Implements org.hibernate.sql.results.jdbc.spi.JdbcValuesMappingProducer.resolve.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Resolve the JdbcValuesMapping.
public NamedResultSetMappingMemento
toMemento(String name)

Implements org.hibernate.query.results.ResultSetMapping.toMemento.

Create a memento from this mapping.
public void
public void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

isDynamicback to summary
private final boolean isDynamic
legacyFetchBuildersback to summary
private Map<String, Map<String, DynamicFetchBuilderLegacy>> legacyFetchBuilders
mappingIdentifierback to summary
private final String mappingIdentifier
resultBuildersback to summary
private List<ResultBuilder> resultBuilders

Constructor Detail

ResultSetMappingImplback to summary
public ResultSetMappingImpl(String mappingIdentifier)
ResultSetMappingImplback to summary
public ResultSetMappingImpl(String mappingIdentifier, boolean isDynamic)
ResultSetMappingImplback to summary
private ResultSetMappingImpl(ResultSetMappingImpl original)

Method Detail

addAffectedTableNamesback to summary
public void addAffectedTableNames(Set<String> affectedTableNames, SessionFactoryImplementor sessionFactory)

Implements org.hibernate.sql.results.jdbc.spi.JdbcValuesMappingProducer.addAffectedTableNames.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Annotations
@Override
addColumnback to summary
private static void addColumn(Set<String> aliases, Set<String> knownDuplicateAliases, String column)
addColumnsback to summary
private static void addColumns(Set<String> aliases, Set<String> knownDuplicateAliases, String[] columns)
addLegacyFetchBuilderback to summary
public void addLegacyFetchBuilder(DynamicFetchBuilderLegacy fetchBuilder)

Implements org.hibernate.query.results.ResultSetMapping.addLegacyFetchBuilder.

Doc from org.hibernate.query.results.ResultSetMapping.addLegacyFetchBuilder.

Add a legacy fetch builder

Annotations
@Override
addResultBuilderback to summary
public void addResultBuilder(ResultBuilder resultBuilder)

Implements org.hibernate.query.results.ResultSetMapping.addResultBuilder.

Doc from org.hibernate.query.results.ResultSetMapping.addResultBuilder.

Add a builder

Annotations
@Override
cacheKeyInstanceback to summary
public JdbcValuesMappingProducer cacheKeyInstance()

Overrides default org.hibernate.sql.results.jdbc.spi.JdbcValuesMappingProducer.cacheKeyInstance.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getMappingIdentifierback to summary
public String getMappingIdentifier()

Implements org.hibernate.query.results.ResultSetMapping.getMappingIdentifier.

Doc from org.hibernate.query.results.ResultSetMapping.getMappingIdentifier.

An identifier for the mapping

Annotations
@Override
getNumberOfResultBuildersback to summary
public int getNumberOfResultBuilders()

Implements org.hibernate.query.results.ResultSetMapping.getNumberOfResultBuilders.

Doc from org.hibernate.query.results.ResultSetMapping.getNumberOfResultBuilders.

The number of result builders currently associated with this mapping

Annotations
@Override
getResultBuildersback to summary
public List<ResultBuilder> getResultBuilders()

Implements org.hibernate.query.results.ResultSetMapping.getResultBuilders.

Doc from org.hibernate.query.results.ResultSetMapping.getResultBuilders.

The result builders currently associated with this mapping

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isDynamicback to summary
public boolean isDynamic()

Implements org.hibernate.query.results.ResultSetMapping.isDynamic.

Doc from org.hibernate.query.results.ResultSetMapping.isDynamic.

Indicates whether the mapping is dynamic per ResultSetMapping

Annotations
@Override
makeImplicitDomainResultback to summary
private DomainResult<?> makeImplicitDomainResult(int valuesArrayPosition, Consumer<SqlSelection> sqlSelectionConsumer, JdbcValuesMetadata jdbcResultsMetadata, SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

resolveback to summary
public JdbcValuesMapping resolve(JdbcValuesMetadata jdbcResultsMetadata, LoadQueryInfluencers loadQueryInfluencers, SessionFactoryImplementor sessionFactory)

Implements org.hibernate.sql.results.jdbc.spi.JdbcValuesMappingProducer.resolve.

Doc from org.hibernate.sql.results.jdbc.spi.JdbcValuesMappingProducer.resolve.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Resolve the JdbcValuesMapping. This involves resolving the org.hibernate.sql.results.graph.DomainResult and org.hibernate.sql.results.graph.Fetch

Annotations
@Override
toMementoback to summary
public NamedResultSetMappingMemento toMemento(String name)

Implements org.hibernate.query.results.ResultSetMapping.toMemento.

Doc from org.hibernate.query.results.ResultSetMapping.toMemento.

Create a memento from this mapping.

Annotations
@Override
visitLegacyFetchBuildersback to summary
public void visitLegacyFetchBuilders(Consumer<DynamicFetchBuilderLegacy> resultBuilderConsumer)

Implements org.hibernate.query.results.ResultSetMapping.visitLegacyFetchBuilders.

Doc from org.hibernate.query.results.ResultSetMapping.visitLegacyFetchBuilders.

Visit the "legacy" fetch builders.

Historically these mappings in Hibernate were defined such that results and fetches are unaware of each other. So while ResultBuilder encapsulates the fetches (see ResultBuilder#visitFetchBuilders), fetches defined in the legacy way are unassociated to their "parent".

Annotations
@Override
visitResultBuildersback to summary
public void visitResultBuilders(BiConsumer<Integer, ResultBuilder> resultBuilderConsumer)

Implements org.hibernate.query.results.ResultSetMapping.visitResultBuilders.

Doc from org.hibernate.query.results.ResultSetMapping.visitResultBuilders.

Visit each result builder

Annotations
@Override