com.speedment.runtime.join.trait.HasJoins Maven / Gradle / Ivy
Show all versions of generator-deploy Show documentation
/*
*
* Copyright (c) 2006-2019, Speedment, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); You may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.speedment.runtime.join.trait;
import com.speedment.runtime.config.identifier.TableIdentifier;
import com.speedment.runtime.field.trait.HasComparableOperators;
/**
* This interface contains the the supported join operations of Speedment.
*
* @author Per Minborg
* @param Return type for all joins except cross join
* @param Return type for cross join
* @since 3.0.23
*/
public interface HasJoins {
/**
* Adds the provided {@code joinedField} to the collection of joined
* column/tables. Elements are joined from the table of the provided
* {@code joinedField} using an INNER JOIN whereby rows from two
* tables are present only if there is a match between the joining columns.
* Thus, rows that do not have matches in the joining columns will not be
* present in the result.
*
* @param entity type
* @param joinedField to add to the current join builder
* @return a builder where the provided {@code joinedField} is added
*
* @throws NullPointerException if the provided {@code joinedField} is
* {@code null}
*/
R innerJoinOn(HasComparableOperators joinedField);
/**
* Adds the provided {@code joinedField} to the collection of joined
* column/tables. Elements are joined from the table of the provided
* {@code joinedField} using an LEFT JOIN whereby rows from two
* tables are present either if there is a match between the joining columns
* or for each row from previously existing table(s).
*
* Unmatched rows will have entities from the table in the given
* {@code joinedField} set to {@code null}
*
* @param entity type
* @param joinedField to add to the current join builder
* @return a builder where the provided {@code joinedField} is added
*
* @throws NullPointerException if the provided {@code joinedField} is
* {@code null}
*/
R leftJoinOn(HasComparableOperators joinedField);
/**
* Adds the provided {@code joinedField} to the collection of joined
* column/tables. Elements are joined from the table of the provided
* {@code joinedField} using an RIGHT JOIN whereby rows from two
* tables are present either if there is a match between the joining columns
* or for each row from the table for the provided {@code joinedField}.
*
* Unmatched rows will have entities from the table in the given
* {@code joinedField} set to {@code null}
*
* @param entity type
* @param joinedField to add to the current join builder
* @return a builder where the provided {@code joinedField} is added
*
* @throws NullPointerException if the provided {@code joinedField} is
* {@code null}
*/
R rightJoinOn(HasComparableOperators joinedField);
/**
* Adds the provided {@code joinedTable} to the collection of joined tables.
* Elements are joined from the table of the provided {@code joinedTable}
* using an CROSS JOIN whereby all combination of rows using all
* tables(s) are produced.
*
* @param entity type
* @param joinedTable to add to the current join builder
* @return a builder where the provided {@code joinedField} is added
*
* @throws NullPointerException if the provided {@code joinedField} is
* {@code null}
*/
RC crossJoin(TableIdentifier joinedTable);
// FULL OUTER JOIN HAS BEEN POSTPONED TO A FUTURE RELEASE
// IT IS NOT SUPPORTED BY MOST RDBMS TYPES
// /**
// * Adds the provided {@code joinedField} to the collection of joined
// * column/tables. Elements are joined from the table of the provided
// * {@code joinedField} using an FULL OUTER JOIN whereby rows from
// * two tables are present either if there is a match between the joining
// * columns or for each row from the provided {@code joinedField} or for each
// * row from previously existing table(s).
// *
// *
// * Unmatched rows will have entities from the table in the given
// * {@code joinedField} set to {@code null}
// *
// * @param entity type
// * @param joinedField to add to the current join builder
// * @return a builder where the provided {@code joinedField} is added
// *
// * @throws NullPointerException if the provided {@code joinedField} is
// * {@code null}
// */
// R fullOuterJoinOn(HasComparableOperators joinedField);
//
// Future joins
//
// R leftSemiJoin(Manager joinedManager);
//
// R rightSemiJoin(Manager joinedManager);
//
//
// R naturalJoin(Manager joinedManager);
//
// R naturalLeftJoin(Manager joinedManager);
//
// R naturalRigthJoin(Manager joinedManager);
}