org.hibernate.query.sqm.tree.domain.AbstractSqmSpecificPluralPartPath 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.NotYetImplementedFor6Exception;
import org.hibernate.metamodel.model.domain.EntityDomainType;
import org.hibernate.metamodel.model.domain.PluralPersistentAttribute;
import org.hibernate.query.NavigablePath;
import org.hibernate.query.PathException;
/**
* @author Steve Ebersole
*/
public abstract class AbstractSqmSpecificPluralPartPath extends AbstractSqmPath implements SqmPath {
private final NavigablePath navigablePath;
private final SqmPath pluralDomainPath;
private final PluralPersistentAttribute pluralAttribute;
private String alias;
@SuppressWarnings("WeakerAccess")
public AbstractSqmSpecificPluralPartPath(
NavigablePath navigablePath,
SqmPath pluralDomainPath,
PluralPersistentAttribute referencedAttribute) {
super(
navigablePath,
referencedAttribute,
pluralDomainPath,
pluralDomainPath.nodeBuilder()
);
this.navigablePath = navigablePath;
this.pluralDomainPath = pluralDomainPath;
this.pluralAttribute = referencedAttribute;
}
@SuppressWarnings("WeakerAccess")
public SqmPath getPluralDomainPath() {
return pluralDomainPath;
}
@SuppressWarnings("WeakerAccess")
public PluralPersistentAttribute getPluralAttribute() {
return pluralAttribute;
}
@Override
public NavigablePath getNavigablePath() {
return navigablePath;
}
@Override
public SqmPath getLhs() {
return pluralDomainPath;
}
@Override
public String getExplicitAlias() {
return alias;
}
@Override
public void setExplicitAlias(String explicitAlias) {
this.alias = explicitAlias;
}
@Override
public SqmTreatedPath treatAs(Class treatJavaType) throws PathException {
if ( getReferencedPathSource().getSqmPathType() instanceof EntityDomainType ) {
throw new NotYetImplementedFor6Exception();
}
throw new UnsupportedOperationException( );
}
@Override
public SqmTreatedPath treatAs(EntityDomainType treatTarget) throws PathException {
return null;
}
}