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

org.fluentjdbc.DatabaseTable Maven / Gradle / Ivy

There is a newer version: 0.5.3
Show newest version
package org.fluentjdbc;

import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.sql.SQLException;
import java.util.List;
import java.util.UUID;
import java.util.stream.Stream;

@ParametersAreNonnullByDefault
public interface DatabaseTable extends DatabaseQueriable {

    DatabaseListableQueryBuilder unordered();

    DatabaseListableQueryBuilder orderBy(String orderByClause);

    DatabaseTableAlias alias(String alias);

    @FunctionalInterface
    interface RowMapper {
        T mapRow(DatabaseRow row) throws SQLException;
    }

    @FunctionalInterface
    interface RowConsumer {
        void apply(DatabaseRow row) throws SQLException;
    }

    String getTableName();

    DatabaseSaveBuilder newSaveBuilder(String idColumn, @Nullable Long idValue);

    /**
     * Use instead of {@link #newSaveBuilder} if the database driver does not
     * support RETURN_GENERATED_KEYS
     */
    DatabaseSaveBuilder newSaveBuilderNoGeneratedKeys(String idColumn, @Nullable Long idValue);

    DatabaseSaveBuilder newSaveBuilderWithUUID(String fieldName, @Nullable UUID uuid);

    DatabaseInsertBuilder insert();

    DatabaseUpdateBuilder update();

     DatabaseBulkInsertBuilder bulkInsert(Iterable objects);

     DatabaseBulkInsertBuilder bulkInsert(Stream objects);

     DatabaseBulkDeleteBuilder bulkDelete(Iterable objects);

     DatabaseBulkUpdateBuilder bulkUpdate(List objects);

    DatabaseDeleteBuilder delete();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy