Package org.hibernate.query.results
Class ResultSetMappingImpl
- java.lang.Object
-
- org.hibernate.query.results.ResultSetMappingImpl
-
- All Implemented Interfaces:
ResultSetMapping,JdbcValuesMappingProducer
@Incubating @Internal public class ResultSetMappingImpl extends Object implements ResultSetMapping
-
-
Constructor Summary
Constructors Constructor Description ResultSetMappingImpl(String mappingIdentifier)ResultSetMappingImpl(String mappingIdentifier, boolean isDynamic)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAffectedTableNames(Set<String> affectedTableNames, SessionFactoryImplementor sessionFactory)voidaddLegacyFetchBuilder(DynamicFetchBuilderLegacy fetchBuilder)Add a legacy fetch buildervoidaddResultBuilder(ResultBuilder resultBuilder)Add a builderJdbcValuesMappingProducercacheKeyInstance()booleanequals(Object o)StringgetMappingIdentifier()An identifier for the mappingintgetNumberOfResultBuilders()The number of result builders currently associated with this mappingList<ResultBuilder>getResultBuilders()The result builders currently associated with this mappinginthashCode()booleanisDynamic()Indicates whether the mapping is dynamic perResultSetMappingJdbcValuesMappingresolve(JdbcValuesMetadata jdbcResultsMetadata, LoadQueryInfluencers loadQueryInfluencers, SessionFactoryImplementor sessionFactory)Resolve the JdbcValuesMapping.NamedResultSetMappingMementotoMemento(String name)Create a memento from this mapping.voidvisitLegacyFetchBuilders(Consumer<DynamicFetchBuilderLegacy> resultBuilderConsumer)Visit the "legacy" fetch builders.voidvisitResultBuilders(BiConsumer<Integer,ResultBuilder> resultBuilderConsumer)Visit each result builder
-
-
-
Method Detail
-
getMappingIdentifier
public String getMappingIdentifier()
Description copied from interface:ResultSetMappingAn identifier for the mapping- Specified by:
getMappingIdentifierin interfaceResultSetMapping
-
isDynamic
public boolean isDynamic()
Description copied from interface:ResultSetMappingIndicates whether the mapping is dynamic perResultSetMapping- Specified by:
isDynamicin interfaceResultSetMapping
-
getNumberOfResultBuilders
public int getNumberOfResultBuilders()
Description copied from interface:ResultSetMappingThe number of result builders currently associated with this mapping- Specified by:
getNumberOfResultBuildersin interfaceResultSetMapping
-
getResultBuilders
public List<ResultBuilder> getResultBuilders()
Description copied from interface:ResultSetMappingThe result builders currently associated with this mapping- Specified by:
getResultBuildersin interfaceResultSetMapping
-
visitResultBuilders
public void visitResultBuilders(BiConsumer<Integer,ResultBuilder> resultBuilderConsumer)
Description copied from interface:ResultSetMappingVisit each result builder- Specified by:
visitResultBuildersin interfaceResultSetMapping
-
visitLegacyFetchBuilders
public void visitLegacyFetchBuilders(Consumer<DynamicFetchBuilderLegacy> resultBuilderConsumer)
Description copied from interface:ResultSetMappingVisit the "legacy" fetch builders. Historically these mappings in Hibernate were defined such that results and fetches are unaware of each other. So whileResultBuilderencapsulates the fetches (seeResultBuilder.visitFetchBuilders(java.util.function.BiConsumer<java.lang.String, org.hibernate.query.results.FetchBuilder>)), fetches defined in the legacy way are unassociated to their "parent".- Specified by:
visitLegacyFetchBuildersin interfaceResultSetMapping
-
addResultBuilder
public void addResultBuilder(ResultBuilder resultBuilder)
Description copied from interface:ResultSetMappingAdd a builder- Specified by:
addResultBuilderin interfaceResultSetMapping
-
addLegacyFetchBuilder
public void addLegacyFetchBuilder(DynamicFetchBuilderLegacy fetchBuilder)
Description copied from interface:ResultSetMappingAdd a legacy fetch builder- Specified by:
addLegacyFetchBuilderin interfaceResultSetMapping
-
addAffectedTableNames
public void addAffectedTableNames(Set<String> affectedTableNames, SessionFactoryImplementor sessionFactory)
- Specified by:
addAffectedTableNamesin interfaceJdbcValuesMappingProducer
-
resolve
public JdbcValuesMapping resolve(JdbcValuesMetadata jdbcResultsMetadata, LoadQueryInfluencers loadQueryInfluencers, SessionFactoryImplementor sessionFactory)
Description copied from interface:JdbcValuesMappingProducerResolve the JdbcValuesMapping. This involves resolving theDomainResultandFetch- Specified by:
resolvein interfaceJdbcValuesMappingProducer
-
toMemento
public NamedResultSetMappingMemento toMemento(String name)
Description copied from interface:ResultSetMappingCreate a memento from this mapping.- Specified by:
toMementoin interfaceResultSetMapping
-
cacheKeyInstance
public JdbcValuesMappingProducer cacheKeyInstance()
- Specified by:
cacheKeyInstancein interfaceJdbcValuesMappingProducer
-
-