mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-28 06:49:09 +00:00
Avoid EntityFetchJoinedImpl visiting the EntityIdentifierMapping
This commit is contained in:
parent
bd28b54482
commit
2afd4c8123
@ -12,6 +12,7 @@
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
import org.hibernate.metamodel.mapping.EntityValuedModelPart;
|
||||
import org.hibernate.query.NavigablePath;
|
||||
import org.hibernate.sql.results.graph.AbstractFetchParent;
|
||||
import org.hibernate.sql.results.graph.AssemblerCreationState;
|
||||
import org.hibernate.sql.results.graph.DomainResultAssembler;
|
||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||
@ -26,18 +27,18 @@
|
||||
*
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
public abstract class AbstractNonLazyEntityFetch extends AbstractEntityResultGraphNode implements EntityFetch {
|
||||
public abstract class AbstractNonLazyEntityFetch extends AbstractFetchParent implements EntityFetch {
|
||||
private final FetchParent fetchParent;
|
||||
private final boolean nullable;
|
||||
private final EntityValuedModelPart referencedModelPart;
|
||||
|
||||
public AbstractNonLazyEntityFetch(
|
||||
FetchParent fetchParent,
|
||||
EntityValuedModelPart fetchedPart,
|
||||
NavigablePath navigablePath,
|
||||
boolean nullable,
|
||||
LockMode lockMode,
|
||||
DomainResultCreationState creationState) {
|
||||
super( fetchedPart, lockMode, navigablePath, creationState );
|
||||
boolean nullable) {
|
||||
super( fetchedPart.getEntityMappingType(), navigablePath );
|
||||
this.referencedModelPart = fetchedPart;
|
||||
this.fetchParent = fetchParent;
|
||||
this.nullable = nullable;
|
||||
}
|
||||
@ -85,4 +86,9 @@ protected abstract EntityInitializer getEntityInitializer(
|
||||
FetchParentAccess parentAccess,
|
||||
Consumer<Initializer> collector,
|
||||
AssemblerCreationState creationState);
|
||||
|
||||
@Override
|
||||
public EntityValuedModelPart getEntityValuedModelPart() {
|
||||
return referencedModelPart;
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.engine.FetchTiming;
|
||||
import org.hibernate.metamodel.mapping.EntityValuedModelPart;
|
||||
import org.hibernate.sql.results.graph.entity.AbstractNonLazyEntityFetch;
|
||||
import org.hibernate.sql.results.graph.entity.EntityInitializer;
|
||||
import org.hibernate.sql.results.graph.entity.EntityValuedFetchable;
|
||||
@ -27,6 +28,7 @@
|
||||
public class EntityFetchJoinedImpl extends AbstractNonLazyEntityFetch {
|
||||
|
||||
private final EntityResultImpl entityResult;
|
||||
private final LockMode lockMode;
|
||||
|
||||
public EntityFetchJoinedImpl(
|
||||
FetchParent fetchParent,
|
||||
@ -35,8 +37,8 @@ public EntityFetchJoinedImpl(
|
||||
boolean nullable,
|
||||
NavigablePath navigablePath,
|
||||
DomainResultCreationState creationState) {
|
||||
super( fetchParent, fetchedAttribute, navigablePath, nullable, lockMode, creationState );
|
||||
|
||||
super( fetchParent, fetchedAttribute, navigablePath, nullable );
|
||||
this.lockMode = lockMode;
|
||||
entityResult = new EntityResultImpl(
|
||||
navigablePath,
|
||||
fetchedAttribute,
|
||||
@ -53,7 +55,7 @@ protected EntityInitializer getEntityInitializer(
|
||||
return new EntityInitializerJoinedFetch(
|
||||
entityResult,
|
||||
getNavigablePath(),
|
||||
getLockMode(),
|
||||
lockMode,
|
||||
entityResult.getIdentifierResult(),
|
||||
entityResult.getDiscriminatorResult(),
|
||||
entityResult.getVersionResult(),
|
||||
@ -71,4 +73,5 @@ public FetchTiming getTiming() {
|
||||
public boolean hasTableGroup() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user