@@ -49,21 +49,19 @@ public List<Issue> findByIds(List<Long> ids) {
4949 /**
5050 * Пакетное добавление нескольких тикетов за один запрос
5151 */
52- public void saveAll (List <TitleAuthor > titleAuthors ) {
52+ public void saveAll (List <String > issues ) {
5353
5454 // Тут описывается структура данных, которая будет служить виртуальной таблицей.
5555 var structType = StructType .of (
5656 "id" , PrimitiveType .Int64 ,
5757 "title" , PrimitiveType .Text ,
58- "author" , OptionalType .of (PrimitiveType .Text ),
5958 "created_at" , PrimitiveType .Timestamp
6059 );
6160
6261 var listIssues = Params .of ("$args" , ListType .of (structType ).newValue (
63- titleAuthors .stream ().map (issue -> structType .newValue (
62+ issues .stream ().map (issue -> structType .newValue (
6463 "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 ),
6765 "created_at" , PrimitiveValue .newTimestamp (Instant .now ())
6866 )).toList ()
6967 ));
@@ -72,7 +70,6 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
7270 DECLARE $args AS List<Struct<
7371 id: Int64,
7472 title: Text,
75- author: Text?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
7673 created_at: Timestamp,
7774 >>;
7875
0 commit comments