All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.graph.SubGraph Maven / Gradle / Ivy

There is a newer version: 6.6.2.Final
Show newest version
/*
 * 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.graph;

import java.util.List;
import javax.persistence.metamodel.Attribute;

/**
 * Hibernate extension to the JPA entity-graph Subgraph contract.
 *
 * @author Steve Ebersole
 * @author Andrea Boriero
 */
public interface SubGraph extends Graph, javax.persistence.Subgraph {
	@Override
	@SuppressWarnings("unchecked")
	default List> getAttributeNodes() {
		return (List) getAttributeNodeList();
	}

	@Override
	default void addAttributeNodes(String... names) {
		if ( names == null ) {
			return;
		}

		for ( String name : names ) {
			addAttributeNode( name );
		}
	}

	@Override
	@SuppressWarnings("unchecked")
	default void addAttributeNodes(Attribute... attribute) {
		if ( attribute == null ) {
			return;
		}

		for ( Attribute node : attribute ) {
			addAttributeNode( node );
		}
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addSubgraph(Attribute attribute) {
		return addSubGraph( attribute );
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addSubgraph(Attribute attribute, Class type) {
		return addSubGraph( attribute, type );
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addSubgraph(String name) {
		return addSubGraph( name );
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addSubgraph(String name, Class type) {
		return addSubGraph( name, type );
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addKeySubgraph(Attribute attribute) {
		return addKeySubGraph( attribute );
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addKeySubgraph(Attribute attribute, Class type) {
		return addKeySubGraph( attribute, type );
	}

	@Override
	default  SubGraph addKeySubgraph(String name) {
		return addKeySubGraph( name );
	}

	@Override
	@SuppressWarnings("unchecked")
	default  SubGraph addKeySubgraph(String name, Class type) {
		return addKeySubGraph( name, type );
	}

	@Override
	@SuppressWarnings("unchecked")
	default Class getClassType() {
		return getGraphedType().getJavaType();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy