失效链接处理 |
R2DBC_Paluch_Folien PDF 下载
本站整理下载:
提取码:h3ks
相关截图:
主要内容:
Driver SPI - Connection
Publisher<Void> beginTransaction()
Publisher<Void> close()
Publisher<Void> commitTransaction()
Batch createBatch()
Publisher<Void> createSavepoint(String name)
Statement createStatement(String sql)
Publisher<Void> releaseSavepoint(String name)
Publisher<Void> rollbackTransaction()
Publisher<Void> rollbackTransactionToSavepoint(String name)
Publisher<Void> setTransactionIsolationLevel(IsolationLevel isolationLevel)
Driver SPI - Statement
Statement add()
Statement bind(Object identifier, Object value)
Statement bind(int index, Object value)
Statement bind(int index, <primitive types> value)
Statement bindNull(Object identifier, Class<?> type)
Statement bindNull(int index, Class<?> type)
Statement returnGeneratedValues(String… columnNames)
Publisher<Result> execute()
Driver SPI - Result and Row
Publisher<Integer> getRowsUpdated()
Publisher<T> map(BiFunction<Row, RowMetadata, ? extends T> f)
T get(Object identifier, Class<T> type);
Object get(Object identifier);
Simple Select
Publisher<Object> values = connectionFactory.create()
.flatMapMany(conn ->
conn.createStatement("SELECT value FROM test")
.execute()
.flatMap(result ->
result.map((row, metadata) -> row.get("value"))))
Simple Select
Publisher<String> values = connectionFactory.create()
.flatMapMany(conn ->
conn.createStatement("SELECT value FROM test")
.execute()
.flatMap(result ->
result.map((row, metadata) -> row.get("value",
String.class))))
Simple Prepared Insert
Publisher<Result> results = connectionFactory.create()
.flatMapMany(conn ->
conn.createStatement("INSERT INTO test VALUES($1, $2)")
.bind("$1", 100).bind("$2", 200).add()
.bind("$1", 300).bind("$2", 400).execute())
|