org.eclipse.persistence.internal.jpa.querydef.CollectionJoinImpl Maven / Gradle / Ivy
Show all versions of eclipselink Show documentation
/*
* Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Gordon Yorke - Initial development
//
package org.eclipse.persistence.internal.jpa.querydef;
import jakarta.persistence.criteria.CollectionJoin;
import jakarta.persistence.criteria.Expression;
import jakarta.persistence.criteria.JoinType;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.metamodel.Bindable;
import jakarta.persistence.metamodel.CollectionAttribute;
import jakarta.persistence.metamodel.ManagedType;
import jakarta.persistence.metamodel.Metamodel;
/**
*
* Purpose: Contains the implementation of the CollectionJoin interface of the JPA
* criteria API.
*
* Description: This class represents a join of an attribute through a collection .
*
* @see jakarta.persistence.criteria From
*
* @author gyorke
* @since EclipseLink 1.2
*/
public class CollectionJoinImpl extends JoinImpl implements CollectionJoin {
public CollectionJoinImpl(Path parentPath, ManagedType managedType, Metamodel metamodel, Class javaClass, org.eclipse.persistence.expressions.Expression expressionNode, Bindable modelArtifact){
this(parentPath, managedType, metamodel, javaClass, expressionNode, modelArtifact,JoinType.INNER);
}
public CollectionJoinImpl(Path parentPath, ManagedType managedType, Metamodel metamodel, Class javaClass, org.eclipse.persistence.expressions.Expression expressionNode, Bindable modelArtifact, JoinType joinType){
super(parentPath, managedType, metamodel, javaClass, expressionNode, modelArtifact, joinType);
}
public CollectionJoinImpl(Path parentPath, ManagedType managedType, Metamodel metamodel, Class javaClass, org.eclipse.persistence.expressions.Expression expressionNode, Bindable modelArtifact, JoinType joinType, FromImpl correlatedParent){
super(parentPath, managedType, metamodel, javaClass, expressionNode, modelArtifact, joinType, correlatedParent);
}
/**
* Return the metamodel representation for the collection.
* @return metamodel type representing the Collection that is
* the target of the join
*/
@Override
public CollectionAttribute super Z, X> getModel(){
return (CollectionAttribute super Z, X>)this.modelArtifact;
}
@Override
public CollectionJoinImpl on(Expression restriction) {
return (CollectionJoinImpl)super.on(restriction);
}
@Override
public CollectionJoinImpl on(Predicate... restrictions) {
return (CollectionJoinImpl)super.on(restrictions);
}
}