org.hibernate.query.sqm.tree.domain.SqmTreatedListJoin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.query.sqm.tree.domain;
import org.hibernate.metamodel.model.domain.EntityDomainType;
import org.hibernate.metamodel.model.domain.ListPersistentAttribute;
import org.hibernate.query.hql.spi.SqmCreationProcessingState;
import org.hibernate.query.hql.spi.SqmCreationState;
import org.hibernate.query.sqm.tree.expression.SqmExpression;
import org.hibernate.query.sqm.tree.from.SqmAttributeJoin;
/**
* @author Steve Ebersole
*/
public class SqmTreatedListJoin extends SqmListJoin implements SqmTreatedPath {
private final SqmListJoin wrappedPath;
private final EntityDomainType treatTarget;
@SuppressWarnings("WeakerAccess")
public SqmTreatedListJoin(
SqmListJoin wrappedPath,
EntityDomainType treatTarget,
String alias) {
//noinspection unchecked
super(
wrappedPath.getLhs(),
(ListPersistentAttribute) wrappedPath.getAttribute(),
alias,
wrappedPath.getSqmJoinType(),
wrappedPath.isFetched(),
wrappedPath.nodeBuilder()
);
this.treatTarget = treatTarget;
this.wrappedPath = wrappedPath;
}
@Override
public SqmListJoin getWrappedPath() {
return wrappedPath;
}
@Override
public ListPersistentAttribute getModel() {
return super.getModel();
}
@Override
public EntityDomainType getTreatTarget() {
return treatTarget;
}
@Override
public SqmPath resolveIndexedAccess(
SqmExpression selector,
boolean isTerminal,
SqmCreationState creationState) {
return getWrappedPath().resolveIndexedAccess( selector, isTerminal, creationState );
}
@Override
public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) {
//noinspection unchecked
return new SqmTreatedListJoin( wrappedPath, treatTarget, getAlias() );
}
}