@@ -49,21 +49,19 @@ public List<Issue> findByIds(List<Long> ids) {
49
49
/**
50
50
* Пакетное добавление нескольких тикетов за один запрос
51
51
*/
52
- public void saveAll (List <TitleAuthor > titleAuthors ) {
52
+ public void saveAll (List <String > issues ) {
53
53
54
54
// Тут описывается структура данных, которая будет служить виртуальной таблицей.
55
55
var structType = StructType .of (
56
56
"id" , PrimitiveType .Int64 ,
57
57
"title" , PrimitiveType .Text ,
58
- "author" , OptionalType .of (PrimitiveType .Text ),
59
58
"created_at" , PrimitiveType .Timestamp
60
59
);
61
60
62
61
var listIssues = Params .of ("$args" , ListType .of (structType ).newValue (
63
- titleAuthors .stream ().map (issue -> structType .newValue (
62
+ issues .stream ().map (issue -> structType .newValue (
64
63
"id" , PrimitiveValue .newInt64 (ThreadLocalRandom .current ().nextLong ()),
65
- "title" , PrimitiveValue .newText (issue .title ()),
66
- "author" , OptionalType .of (PrimitiveType .Text ).newValue (PrimitiveValue .newText (issue .author ())),
64
+ "title" , PrimitiveValue .newText (issue ),
67
65
"created_at" , PrimitiveValue .newTimestamp (Instant .now ())
68
66
)).toList ()
69
67
));
@@ -72,7 +70,6 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
72
70
DECLARE $args AS List<Struct<
73
71
id: Int64,
74
72
title: Text,
75
- author: Text?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
76
73
created_at: Timestamp,
77
74
>>;
78
75
0 commit comments