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

com.speedment.runtime.join.builder.JoinBuilder2 Maven / Gradle / Ivy

Go to download

A Speedment bundle that shades all dependencies into one jar. This is useful when deploying an application on a server.

The newest version!
/*
 *
 * 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.builder;

import com.speedment.common.tuple.Tuple;
import com.speedment.common.tuple.TuplesOfNullables;
import com.speedment.common.tuple.nullable.Tuple2OfNullables;
import com.speedment.runtime.config.identifier.TableIdentifier;
import com.speedment.runtime.field.trait.HasComparableOperators;
import com.speedment.runtime.join.Join;
import com.speedment.runtime.join.trait.HasDefaultBuild;
import com.speedment.runtime.join.trait.HasJoins;
import com.speedment.runtime.join.trait.HasOnPredicates;
import com.speedment.runtime.join.trait.HasWhere;

import java.util.function.BiFunction;

/**
 * Join Builder stage used when only 2 tables has been specified so far.
 *
 * @param   the first entity type
 * @param   the second entity type
 *
 * @author Per Minborg
 * @author Emil Forslund
 * @since  3.1.1
 */
public interface JoinBuilder2
    extends HasJoins, JoinBuilder3>,
            HasWhere>,
            HasDefaultBuild> {

    @Override
     AfterJoin innerJoinOn(HasComparableOperators joinedField);

    @Override
     AfterJoin leftJoinOn(HasComparableOperators joinedField);

    @Override
     AfterJoin rightJoinOn(HasComparableOperators joinedField);

//            @Override
//             AfterJoin fullOuterJoinOn(HasComparableOperators joinedField);

    @Override
     JoinBuilder3 crossJoin(TableIdentifier joinedTable);

    @Override
    default Join> build() {
        return build(TuplesOfNullables::ofNullables);
    }

    /**
     * Creates and returns a new Join object where elements in the Join
     * object's stream method is created using the provided {@code
     * constructor}.
     *
     * @param          the type of element in the Join object's stream
     *                    method.
     * @param constructor to use to create stream elements.
     * @return a new Join object where elements in the Join object's stream
     *     method is of a default {@link Tuple} type
     *
     * @throws NullPointerException if the provided {@code constructor } is
     *                              {@code null}
     */
     Join build(BiFunction constructor);

    interface AfterJoin
    extends HasOnPredicates> {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy