Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.firefly.reactive.adapter.db;
import com.firefly.db.SQLConnection;
import com.firefly.db.SQLResultSet;
import com.firefly.db.TransactionIsolation;
import com.firefly.utils.function.Func1;
import reactor.core.publisher.Mono;
import java.util.List;
import java.util.Map;
/**
* SQLConnection reactor adapter. It wraps SQLConnection using Spring reactor.
*
* @author Pengtao Qiu
*/
public interface ReactiveSQLConnection {
/**
* Query single column record by SQL. If the database has not record, it will emit the RecordNotFound exception.
*
* @param sql An SQL that may contain one or more '?' placeholders.
* @param params SQL parameters.
* @param The type of column.
* @return The result that is wrapped by Mono.
*/
Mono queryForSingleColumn(String sql, Object... params);
/**
* Query single column record by named SQL. If the database has not record, it will emit the RecordNotFound exception.
*
* @param sql A SQL that may contain one or more placeholders. The placeholder starts with ":" or "&", such as,
* "select * from test where id in (:idList)",
* "select * from test where id = :id",
* "select * from test where id = :{id}",
* "select * from test where id = &id"
* @param paramMap Named SQL parameters.
* @param The type of column.
* @return The future result.
*/
Mono namedQueryForSingleColumn(String sql, Map paramMap);
/**
* Query single column record by named SQL. If the database has not record, it will emit the RecordNotFound exception.
*
* @param sql A SQL that may contain one or more placeholders. The placeholder starts with ":" or "&", such as,
* "select * from test where id in (:idList)",
* "select * from test where id = :id",
* "select * from test where id = :{id}",
* "select * from test where id = &id"
* @param paramObject Named SQL parameter object that uses the property name to match parameter.
* @param The type of column.
* @return The future result.
*/
Mono namedQueryForSingleColumn(String sql, Object paramObject);
/**
* Query record and bind object. If the database has not record, it will emit the RecordNotFound exception.
*
* @param sql A SQL that may contain one or more '?' placeholders.
* @param clazz The Class reference of bound object.
* @param params SQL parameters.
* @param The type of bound object.
* @return The result that binds to Class and it is wrapped by Mono.
*/
Mono queryForObject(String sql, Class clazz, Object... params);
/**
* Query record and bind object. If the database has not record, it will emit the RecordNotFound exception.
*
* @param sql A SQL that may contain one or more placeholders. The placeholder starts with ":" or "&", such as,
* "select * from test where id in (:idList)",
* "select * from test where id = :id",
* "select * from test where id = :{id}",
* "select * from test where id = &id"
* @param clazz The Class reference of bound object.
* @param paramMap Named SQL parameters.
* @param The type of bound object.
* @return The result that binds to Class and it is wrapped by Mono.
*/
Mono namedQueryForObject(String sql, Class clazz, Map paramMap);
/**
* Query record and bind object. If the database has not record, it will emit the RecordNotFound exception.
*
* @param sql A SQL that may contain one or more placeholders. The placeholder starts with ":" or "&", such as,
* "select * from test where id in (:idList)",
* "select * from test where id = :id",
* "select * from test where id = :{id}",
* "select * from test where id = &id"
* @param clazz The Class reference of bound object.
* @param paramObject Named SQL parameters.
* @param The type of bound object.
* @return The result that binds to Class and it is wrapped by Mono.
*/
Mono namedQueryForObject(String sql, Class clazz, Object paramObject);
/**
* Query record by id. If the database has not record, it will emit the RecordNotFound exception.
*
* @param id Primary key.
* @param clazz The Class reference of bound object.
* @param The type of bound object.
* @return The result that binds to Class and it is wrapped by Mono.
*/
Mono queryById(Object id, Class clazz);
/**
* Query records and convert records to a Map.
*
* @param sql A SQL that may contain one or more '?' placeholders.
* @param valueClass The Class reference of bound object.
* @param params SQL parameters.
* @param The type of primary key.
* @param The type of bound object.
* @return The result that contains a map, the key is primary key of record, the value is bound object. And it is wrapped by Mono.
*/
Mono