vttranlina commented on code in PR #2135:
URL: https://github.com/apache/james-project/pull/2135#discussion_r1533195172


##########
server/data/data-jmap-postgres/src/main/java/org/apache/james/jmap/postgres/upload/PostgresUploadDAO.java:
##########
@@ -71,14 +71,21 @@ public 
PostgresUploadDAO(@Named(PostgresExecutor.NON_RLS_INJECT) PostgresExecuto
         this.blobIdFactory = blobIdFactory;
     }
 
-    public Mono<Void> insert(UploadMetaData upload, Username user) {
-        return postgresExecutor.executeVoid(dslContext -> 
Mono.from(dslContext.insertInto(PostgresUploadTable.TABLE_NAME)
-            .set(PostgresUploadTable.ID, upload.uploadId().getId())
-            .set(PostgresUploadTable.CONTENT_TYPE, 
upload.contentType().asString())
-            .set(PostgresUploadTable.SIZE, upload.sizeAsLong())
-            .set(PostgresUploadTable.BLOB_ID, upload.blobId().asString())
-            .set(PostgresUploadTable.USER_NAME, user.asString())
-            .set(PostgresUploadTable.UPLOAD_DATE, 
INSTANT_TO_LOCAL_DATE_TIME.apply(upload.uploadDate()))));
+    public Mono<UploadMetaData> insert(UploadMetaData upload, Username user) {
+        return postgresExecutor.executeRow(dslContext -> 
Mono.from(dslContext.insertInto(PostgresUploadTable.TABLE_NAME)
+                .set(PostgresUploadTable.ID, upload.uploadId().getId())
+                .set(PostgresUploadTable.CONTENT_TYPE, 
upload.contentType().asString())
+                .set(PostgresUploadTable.SIZE, upload.sizeAsLong())
+                .set(PostgresUploadTable.BLOB_ID, upload.blobId().asString())
+                .set(PostgresUploadTable.USER_NAME, user.asString())
+                .set(PostgresUploadTable.UPLOAD_DATE, 
INSTANT_TO_LOCAL_DATE_TIME.apply(upload.uploadDate()))
+                .returning(PostgresUploadTable.ID,
+                    PostgresUploadTable.CONTENT_TYPE,
+                    PostgresUploadTable.SIZE,
+                    PostgresUploadTable.BLOB_ID,
+                    PostgresUploadTable.UPLOAD_DATE,
+                    PostgresUploadTable.USER_NAME)))

Review Comment:
   I thought it first when implemented, 
   but only return upload_date, the code looks quite confuse after long time. 
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to