Skip to content

Commit

Permalink
AB#1011 Correctly insert datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvoosten committed Jan 15, 2025
1 parent 85b913e commit 758084b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/java/mil/dds/anet/database/MartImportedReportDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import mil.dds.anet.beans.lists.AnetBeanList;
import mil.dds.anet.beans.mart.MartImportedReport;
import mil.dds.anet.database.mappers.MartImportedReportMapper;
import mil.dds.anet.utils.DaoUtils;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.statement.Query;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -53,21 +54,16 @@ public AnetBeanList<MartImportedReport> getAll(int pageNum, int pageSize) {
}
}

/**
* Inserts martImportedReport in the database
*
* @param martImportedReport the mart imported report
* @return number of rows inserted/updated
*/
@Transactional
public int insert(final MartImportedReport martImportedReport) {
final Handle handle = getDbHandle();
try {
return handle
.createUpdate("/* upsertMartImportedReport */ INSERT INTO \"martImportedReports\" "
.createUpdate("/* insertMartImportedReport */ INSERT INTO \"martImportedReports\" "
+ "(\"personUuid\", \"reportUuid\", success, \"createdAt\", errors) "
+ "VALUES (:personUuid, :reportUuid, :success, :createdAt, :errors) ")
.bindBean(martImportedReport).execute();
.bindBean(martImportedReport)
.bind("createdAt", DaoUtils.asLocalDateTime(martImportedReport.getCreatedAt())).execute();
} finally {
closeDbHandle(handle);
}
Expand Down

0 comments on commit 758084b

Please sign in to comment.