org.hibernate.query.sqm.tree.domain.SqmTreatedSetJoin 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.SetPersistentAttribute;
import org.hibernate.query.hql.spi.SqmCreationProcessingState;
import org.hibernate.query.sqm.tree.from.SqmAttributeJoin;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
/**
* @author Steve Ebersole
*/
public class SqmTreatedSetJoin extends SqmSetJoin implements SqmTreatedPath {
private final SqmSetJoin wrappedPath;
private final EntityDomainType treatTarget;
@SuppressWarnings("WeakerAccess")
public SqmTreatedSetJoin(
SqmSetJoin wrappedPath,
EntityDomainType treatTarget,
String alias) {
//noinspection unchecked
super(
wrappedPath.getLhs(),
(SetPersistentAttribute) wrappedPath.getAttribute(),
alias,
wrappedPath.getSqmJoinType(),
wrappedPath.isFetched(),
wrappedPath.nodeBuilder()
);
this.treatTarget = treatTarget;
this.wrappedPath = wrappedPath;
}
@Override
public SqmSetJoin getWrappedPath() {
return wrappedPath;
}
@Override
public SetPersistentAttribute getModel() {
return super.getModel();
}
@Override
public EntityDomainType getTreatTarget() {
return treatTarget;
}
@Override
public SetPersistentAttribute getReferencedPathSource() {
return super.getReferencedPathSource();
}
@Override
public JavaTypeDescriptor getJavaTypeDescriptor() {
//noinspection unchecked
return (JavaTypeDescriptor) wrappedPath.getJavaTypeDescriptor();
}
@Override
public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) {
//noinspection unchecked
return new SqmTreatedSetJoin( wrappedPath, treatTarget, getAlias() );
}
}