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

org.jnosql.artemis.column.query.ColumnMapperQueryBuild Maven / Gradle / Ivy

/*
 *
 *  Copyright (c) 2017 Otávio Santana and others
 *   All rights reserved. This program and the accompanying materials
 *   are made available under the terms of the Eclipse Public License v1.0
 *   and Apache License v2.0 which accompanies this distribution.
 *   The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 *   and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
 *
 *   You may elect to redistribute this code under either of these licenses.
 *
 *   Contributors:
 *
 *   Otavio Santana
 *
 */
package org.jnosql.artemis.column.query;

import org.jnosql.artemis.column.ColumnTemplate;
import org.jnosql.artemis.column.ColumnTemplateAsync;
import org.jnosql.diana.api.column.ColumnQuery;

import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;

/**
 * The last step to the build of {@link ColumnQuery}.
 * It either can return a new {@link ColumnQuery} instance or execute a query with
 * {@link org.jnosql.artemis.column.ColumnTemplate} and {@link org.jnosql.artemis.column.ColumnTemplateAsync}
 */
public interface ColumnMapperQueryBuild {

    /**
     * Creates a new instance of {@link ColumnQuery}
     *
     * @return a new {@link ColumnQuery} instance
     */
    ColumnQuery build();


    /**
     * Executes {@link ColumnTemplate#select(ColumnQuery)}
     *
     * @param       the entity type
     * @param template the column template
     * @return the result of {@link ColumnTemplate#select(ColumnQuery)}
     * @throws NullPointerException when manager is null
     */
     List execute(ColumnTemplate template);

    /**
     * Executes {@link ColumnTemplate#singleResult(ColumnQuery)}
     *
     * @param       the entity type
     * @param template the column template
     * @return the result of {@link ColumnTemplate#singleResult(ColumnQuery)}
     * @throws NullPointerException when manager is null
     */
     Optional executeSingle(ColumnTemplate template);

    /**
     * Executes {@link ColumnTemplateAsync#select(ColumnQuery, Consumer)}
     *
     * @param       the entity type
     * @param template the column template
     * @param callback the callback
     * @throws NullPointerException when there is null parameter
     */
     void execute(ColumnTemplateAsync template, Consumer> callback);

    /**
     * Executes {@link ColumnTemplateAsync#singleResult(ColumnQuery, Consumer)}
     *
     * @param       the entity type
     * @param template the column template
     * @param callback the callback
     * @throws NullPointerException when there is null parameter
     */
     void executeSingle(ColumnTemplateAsync template, Consumer> callback);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy