|
| 1 | +/* Hibernate, Relational Persistence for Idiomatic Java |
| 2 | + * |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * Copyright: Red Hat Inc. and Hibernate Authors |
| 5 | + */ |
| 6 | +package org.hibernate.reactive.sql.results.internal; |
| 7 | + |
| 8 | +import org.hibernate.metamodel.mapping.EntityValuedModelPart; |
| 9 | +import org.hibernate.reactive.sql.results.graph.entity.internal.ReactiveEntityAssembler; |
| 10 | +import org.hibernate.reactive.sql.results.graph.entity.internal.ReactiveEntityResultInitializer; |
| 11 | +import org.hibernate.spi.NavigablePath; |
| 12 | +import org.hibernate.sql.ast.tree.from.TableGroup; |
| 13 | +import org.hibernate.sql.results.graph.AssemblerCreationState; |
| 14 | +import org.hibernate.sql.results.graph.DomainResultAssembler; |
| 15 | +import org.hibernate.sql.results.graph.FetchParentAccess; |
| 16 | +import org.hibernate.sql.results.graph.Initializer; |
| 17 | +import org.hibernate.sql.results.graph.entity.internal.EntityResultJoinedSubclassImpl; |
| 18 | + |
| 19 | +/** |
| 20 | + * @see org.hibernate.sql.results.graph.entity.internal.EntityResultJoinedSubclassImpl |
| 21 | + */ |
| 22 | +public class ReactiveEntityResultJoinedSubclassImpl extends EntityResultJoinedSubclassImpl { |
| 23 | + |
| 24 | + public ReactiveEntityResultJoinedSubclassImpl( |
| 25 | + NavigablePath navigablePath, |
| 26 | + EntityValuedModelPart entityValuedModelPart, |
| 27 | + TableGroup tableGroup, |
| 28 | + String resultVariable) { |
| 29 | + super( navigablePath, entityValuedModelPart, tableGroup, resultVariable ); |
| 30 | + } |
| 31 | + |
| 32 | + @Override |
| 33 | + public DomainResultAssembler createResultAssembler( |
| 34 | + FetchParentAccess parentAccess, |
| 35 | + AssemblerCreationState creationState) { |
| 36 | + final Initializer initializer = creationState.resolveInitializer( |
| 37 | + getNavigablePath(), |
| 38 | + getReferencedModePart(), |
| 39 | + () -> new ReactiveEntityResultInitializer( |
| 40 | + this, |
| 41 | + getNavigablePath(), |
| 42 | + getLockMode( creationState ), |
| 43 | + getIdentifierFetch(), |
| 44 | + getDiscriminatorFetch(), |
| 45 | + getRowIdResult(), |
| 46 | + creationState |
| 47 | + ) |
| 48 | + ); |
| 49 | + |
| 50 | + return new ReactiveEntityAssembler( this.getResultJavaType(), initializer.asEntityInitializer() ); |
| 51 | + } |
| 52 | +} |
0 commit comments