This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// backテーブルのcountryカラムのセカンダリインデックスを用いたGetクエリ | |
query BankGetWithIndex { | |
get_with_index: bank_getWithIndexOn_country(get: {indexKey : {country:"france"}}){ | |
bank {id, region_code, country} | |
} | |
} | |
// backテーブルのregion_codeカラムのセカンダリインデックスを用いたScanクエリ | |
query BankScanWithIndex { | |
scan_with_index: bank_scanWithIndexOn_region_code(scan: {indexKey: {region_code: 1}}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get query with a secondary index on the “country” column of the “back” table | |
query BankGetWithIndex { | |
get_with_index: bank_getWithIndexOn_country(get: {indexKey : {country:"france"}}){ | |
bank {id, region_code, country} | |
} | |
} | |
// Scan query with a secondary index on the “region_code” column of the “bank” table | |
query BankScanWithIndex { | |
scan_with_index: bank_scanWithIndexOn_region_code(scan: {indexKey: {region_code: 1}}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query BankScanAllWithLimit { | |
scanAll_with_limit: bank_scanAll(scanAll: {limit: 1}){ | |
bank {id, region, country} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query BankScanAll { | |
scanAll: bank_scanAll(scanAll: {}){ | |
bank {id, region, country} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
public interface NorthAccountRepository | |
extends PagingAndSortingRepository<NorthAccount, Integer>, | |
ScalarDbHelperRepository<NorthAccount> { | |
@Transactional | |
default void transferToSouthAccount( | |
@Nonnull SouthAccountRepository southAccountRepository, | |
int fromId, int toId, int value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Result result = …; | |
// Boolean型の値を取得 | |
boolean booleanValue = result.getBoolean("<column name>"); | |
// Int型の値を取得 | |
int intValue = result.getInt("<column name>"); | |
// BigInt型の値を取得 | |
long bigIntValue = result.getBigInt("<column name>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Getオペレーションの作成 | |
Get get = | |
Get.newBuilder() | |
.namespace("ns") | |
.table("tbl") | |
.partitionKey(Key.ofInt("c1", 10)) | |
.clusteringKey(Key.of("c2", "aaa", "c3", 100L)) | |
.projections("c1", "c2", "c3", "c4") | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isNull = result.isNull("<column name>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Result result = …; | |
// Get a Boolean value of a column | |
boolean booleanValue = result.getBoolean("<column name>"); | |
// Get an Int value of a column | |
int intValue = result.getInt("<column name>"); | |
// Get a BigInt value of a column | |
long bigIntValue = result.getBigInt("<column name>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Put put = | |
Put.newBuilder() | |
.namespace("ns") | |
.table("tbl") | |
.partitionKey(Key.ofInt("c1", 10)) | |
.clusteringKey(Key.of("c2", "aaa", "c3", 100L)) | |
.booleanValue("c1", null) | |
.intValue("c2", null) | |
.bigIntValue("c3", null) | |
.floatValue("c4", null) |
NewerOlder