Skip to content

Commit 1526388

Browse files
delete UUID
1 parent 7bc57bb commit 1526388

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

dev-1/lesson-8.1/java/src/main/java/tech/ydb/app/IssueYdbRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
7777
id: Int64,
7878
title: Text,
7979
author: Text?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
80-
created_at: Timestamp,
80+
created_at: Timestamp,
8181
>>;
8282
8383
UPSERT INTO issues

dev-1/lesson-8.2/java/src/main/java/tech/ydb/app/IssueYdbRepository.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
5050
var structType = StructType.of(
5151
"id", PrimitiveType.Int64,
5252
"title", PrimitiveType.Text,
53-
"author", PrimitiveType.Text,
54-
"created_at", OptionalType.of(PrimitiveType.Timestamp)
53+
"author", OptionalType.of(PrimitiveType.Text),
54+
"created_at", PrimitiveType.Timestamp
5555
);
5656

5757
var listIssues = Params.of("$args", ListType.of(structType).newValue(
5858
titleAuthors.stream().map(issue -> structType.newValue(
59-
"id", PrimitiveValue.newInt64(ThreadLocalRandom.current().nextInt()),
59+
"id", PrimitiveValue.newInt64(ThreadLocalRandom.current().nextLong()),
6060
"title", PrimitiveValue.newText(issue.title()),
61-
"author", PrimitiveValue.newText(issue.author()),
62-
"created_at", OptionalType.of(PrimitiveType.Timestamp)
63-
.newValue(PrimitiveValue.newTimestamp(Instant.now()))
61+
"author", OptionalType.of(PrimitiveType.Text).newValue(PrimitiveValue.newText(issue.author())),
62+
"created_at", PrimitiveValue.newTimestamp(Instant.now())
6463
)).toList()
6564
));
6665

@@ -70,8 +69,8 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
7069
DECLARE $args AS List<Struct<
7170
id: Int64,
7271
title: Text,
73-
author: Text,
74-
created_at: Timestamp?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
72+
author: Text?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
73+
created_at: Timestamp,
7574
>>;
7675
7776
UPSERT INTO issues

0 commit comments

Comments
 (0)