code: private void closeMappedEntity(final MappedEntity mappedEntity) {
  
          try {
              // Flush first
              final PreparedStatement insert = mappedEntity.getInsert();
              final PreparedStatement insertReturning = mappedEntity.getInsertReturning();
              final PreparedStatement insertWithAutoInc = mappedEntity.getInsertWithAutoInc();
  
              insert.executeBatch();
  
              if (insertReturning != null) {
                  insertReturning.executeBatch();
              }
  
              if (insertWithAutoInc != null) {
                  insertWithAutoInc.executeBatch();
              }
  
          } catch (final SQLException e) {
              logger.debug(String.format("Failed to flush before closing mapped entity '%s'",
                      mappedEntity.getEntity().getName()), e);
  
          } finally {
              try {
                  mappedEntity.close();
              } catch (final Exception e) {
                  logger.warn("Could not close insert statements from mapped entity.", e);
              }
          }
  
      }
docs: Closes a {@link MappedEntity}, logging a warning if an {@link Exception} is thrown.
  <p>
  It flushes before closing the {@link MappedEntity}.
  
  @param mappedEntity The mapped entity to close.
  @since 2.1.13