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 void
addAffectedTableNames(Set<String> affectedTableNames, SessionFactoryImplementor sessionFactory)
void
addLegacyFetchBuilder(DynamicFetchBuilderLegacy fetchBuilder)
Add a legacy fetch buildervoid
addResultBuilder(ResultBuilder resultBuilder)
Add a builderJdbcValuesMappingProducer
cacheKeyInstance()
boolean
equals(Object o)
String
getMappingIdentifier()
An identifier for the mappingint
getNumberOfResultBuilders()
The number of result builders currently associated with this mappingList<ResultBuilder>
getResultBuilders()
The result builders currently associated with this mappingint
hashCode()
boolean
isDynamic()
Indicates whether the mapping is dynamic perResultSetMapping
JdbcValuesMapping
resolve(JdbcValuesMetadata jdbcResultsMetadata, LoadQueryInfluencers loadQueryInfluencers, SessionFactoryImplementor sessionFactory)
Resolve the JdbcValuesMapping.NamedResultSetMappingMemento
toMemento(String name)
Create a memento from this mapping.void
visitLegacyFetchBuilders(Consumer<DynamicFetchBuilderLegacy> resultBuilderConsumer)
Visit the "legacy" fetch builders.void
visitResultBuilders(BiConsumer<Integer,ResultBuilder> resultBuilderConsumer)
Visit each result builder
-
-
-
Method Detail
-
getMappingIdentifier
public String getMappingIdentifier()
Description copied from interface:ResultSetMapping
An identifier for the mapping- Specified by:
getMappingIdentifier
in interfaceResultSetMapping
-
isDynamic
public boolean isDynamic()
Description copied from interface:ResultSetMapping
Indicates whether the mapping is dynamic perResultSetMapping
- Specified by:
isDynamic
in interfaceResultSetMapping
-
getNumberOfResultBuilders
public int getNumberOfResultBuilders()
Description copied from interface:ResultSetMapping
The number of result builders currently associated with this mapping- Specified by:
getNumberOfResultBuilders
in interfaceResultSetMapping
-
getResultBuilders
public List<ResultBuilder> getResultBuilders()
Description copied from interface:ResultSetMapping
The result builders currently associated with this mapping- Specified by:
getResultBuilders
in interfaceResultSetMapping
-
visitResultBuilders
public void visitResultBuilders(BiConsumer<Integer,ResultBuilder> resultBuilderConsumer)
Description copied from interface:ResultSetMapping
Visit each result builder- Specified by:
visitResultBuilders
in interfaceResultSetMapping
-
visitLegacyFetchBuilders
public void visitLegacyFetchBuilders(Consumer<DynamicFetchBuilderLegacy> resultBuilderConsumer)
Description copied from interface:ResultSetMapping
Visit the "legacy" fetch builders. Historically these mappings in Hibernate were defined such that results and fetches are unaware of each other. So whileResultBuilder
encapsulates 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:
visitLegacyFetchBuilders
in interfaceResultSetMapping
-
addResultBuilder
public void addResultBuilder(ResultBuilder resultBuilder)
Description copied from interface:ResultSetMapping
Add a builder- Specified by:
addResultBuilder
in interfaceResultSetMapping
-
addLegacyFetchBuilder
public void addLegacyFetchBuilder(DynamicFetchBuilderLegacy fetchBuilder)
Description copied from interface:ResultSetMapping
Add a legacy fetch builder- Specified by:
addLegacyFetchBuilder
in interfaceResultSetMapping
-
addAffectedTableNames
public void addAffectedTableNames(Set<String> affectedTableNames, SessionFactoryImplementor sessionFactory)
- Specified by:
addAffectedTableNames
in interfaceJdbcValuesMappingProducer
-
resolve
public JdbcValuesMapping resolve(JdbcValuesMetadata jdbcResultsMetadata, LoadQueryInfluencers loadQueryInfluencers, SessionFactoryImplementor sessionFactory)
Description copied from interface:JdbcValuesMappingProducer
Resolve the JdbcValuesMapping. This involves resolving theDomainResult
andFetch
- Specified by:
resolve
in interfaceJdbcValuesMappingProducer
-
toMemento
public NamedResultSetMappingMemento toMemento(String name)
Description copied from interface:ResultSetMapping
Create a memento from this mapping.- Specified by:
toMemento
in interfaceResultSetMapping
-
cacheKeyInstance
public JdbcValuesMappingProducer cacheKeyInstance()
- Specified by:
cacheKeyInstance
in interfaceJdbcValuesMappingProducer
-
-