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

com.jwebmp.entityassist.querybuilder.builders.JoinExpression Maven / Gradle / Ivy

There is a newer version: 0.68.0.1
Show newest version
package com.jwebmp.entityassist.querybuilder.builders;

import com.jwebmp.entityassist.BaseEntity;
import com.jwebmp.entityassist.querybuilder.QueryBuilder;

import javax.persistence.criteria.From;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.JoinType;
import javax.persistence.criteria.Root;
import javax.persistence.metamodel.Attribute;

/**
 * Public join expression
 */
@SuppressWarnings("unused")
public final class JoinExpression, Y,Z>
{
	/**
	 * The query build that will run the execution for the join
	 */
	private QueryBuilder executor;
	/**
	 * The given join type
	 */
	private JoinType joinType;
	/**
	 * The attribute type to apply
	 */
	private Attribute attribute;
	/**
	 * The builder to use for the on clause
	 */
	private QueryBuilder onBuilder;
	/**
	 * The generated root from the join
	 */
	private Join generatedRoot;

	/**
	 * The join expression to build
	 */
	public JoinExpression()
	{
		//No config required
	}

	/**
	 * A new expression with the given configurations
	 *
	 * @param executor
	 * 		The Query Builder to use
	 * @param joinType
	 * 		The join type to apply
	 * @param attribute
	 * 		The attribute to apply it with
	 */
	@SuppressWarnings("WeakerAccess")
	public JoinExpression(QueryBuilder executor, JoinType joinType, Attribute attribute)
	{
		this.executor = executor;
		this.joinType = joinType;
		this.attribute = attribute;
	}

	@SuppressWarnings("WeakerAccess")
	public JoinExpression(QueryBuilder executor, JoinType joinType, Attribute attribute, QueryBuilder onBuilder)
	{
		this.executor = executor;
		this.joinType = joinType;
		this.attribute = attribute;
		this.onBuilder = onBuilder;
	}

	/**
	 * Method getExecutor returns the executor of this JoinExpression object.
	 * 

* The query build that will run the execution for the join * * @return the executor (type QueryBuilder ?, X, ? ) of this JoinExpression object. */ public QueryBuilder getExecutor() { return executor; } /** * Method setExecutor sets the executor of this JoinExpression object. *

* The query build that will run the execution for the join * * @param executor * the executor of this JoinExpression object. */ public void setExecutor(QueryBuilder executor) { this.executor = executor; } /** * Method getJoinType returns the joinType of this JoinExpression object. *

* The given join type * * @return the joinType (type JoinType) of this JoinExpression object. */ public JoinType getJoinType() { return joinType; } /** * Method setJoinType sets the joinType of this JoinExpression object. *

* The given join type * * @param joinType * the joinType of this JoinExpression object. */ public void setJoinType(JoinType joinType) { this.joinType = joinType; } /** * Method getAttribute returns the attribute of this JoinExpression object. *

* The attribute type to apply * * @return the attribute (type Attribute X, Y) of this JoinExpression object. */ public Attribute getAttribute() { return attribute; } /** * Method setAttribute sets the attribute of this JoinExpression object. *

* The attribute type to apply * * @param attribute * the attribute of this JoinExpression object. */ public void setAttribute(Attribute attribute) { this.attribute = attribute; } /** * Getter for property 'onBuilder'. * * @return Value for property 'onBuilder'. */ public QueryBuilder getOnBuilder() { return onBuilder; } /** * Setter for property 'onBuilder'. * * @param onBuilder * Value to set for property 'onBuilder'. */ public void setOnBuilder(QueryBuilder onBuilder) { this.onBuilder = onBuilder; } /** * The generated root if any * @return */ public Join getGeneratedRoot() { return generatedRoot; } /** * The generated root * @param generatedRoot * @return */ public JoinExpression setGeneratedRoot(Join generatedRoot) { this.generatedRoot = generatedRoot; return this; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy