Aman-Mittal commented on code in PR #78:
URL:
https://github.com/apache/fineract-consumer-facing/pull/78#discussion_r3683241502
##########
consumer/src/main/java/org/apache/fineract/consumer/loans/command/service/LoansCommandServiceImpl.java:
##########
@@ -76,7 +74,6 @@ public LoanApplicationCommandData submitApplication(Jwt jwt,
SubmitLoanApplicati
}
@Override
- @Command
public LoanApplicationCommandData modifyApplication(Jwt jwt,
ModifyLoanApplicationCommand command) {
Review Comment:
Why removed command?
##########
consumer/src/main/java/org/apache/fineract/consumer/audit/command/repository/AuditEventCommandRepository.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fineract.consumer.audit.command.repository;
+
+import java.time.Instant;
+import org.apache.fineract.consumer.audit.command.domain.AuditEvent;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.transaction.annotation.Transactional;
+
+public interface AuditEventCommandRepository extends JpaRepository<AuditEvent,
Long> {
+
+ @Transactional
+ @Modifying
+ @Query(nativeQuery = true, value = "DELETE FROM audit_events WHERE id IN "
+ + "(SELECT id FROM audit_events WHERE source = :source AND
received_at < :cutoff LIMIT :batchSize)")
Review Comment:
use @Query(
nativeQuery = true,
value = """
DELETE FROM audit_events
WHERE id IN (
SELECT id
FROM audit_events
WHERE source = :source
AND received_at < :cutoff
LIMIT :batchSize
)
"""
)
--
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]