@Test @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) public void test_update() { InstrumentVoucherEntity instrumentVoucher = InstrumentVoucherEntity.builder().id("1").instrumentId("1") .voucherHeaderId("1").receiptHeaderId("1").build(); instrumentVoucher.setTenantId("default"); InstrumentVoucherEntity actualResult = instrumentVoucherJdbcRepository.update(instrumentVoucher); List<Map<String, Object>> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentVoucher", new InstrumentVoucherResultExtractor()); Map<String, Object> row = result.get(0); assertThat(row.get("instrumentId")).isEqualTo(actualResult.getInstrumentId()); assertThat(row.get("voucherHeaderId")).isEqualTo(actualResult.getVoucherHeaderId()); assertThat(row.get("receiptHeaderId")).isEqualTo(actualResult.getReceiptHeaderId()); }
public InstrumentVoucherEntity update(InstrumentVoucherEntity entity) { super.update(entity); return entity; }
InstrumentVoucherJdbcRepository extends JdbcRepository { public InstrumentVoucherEntity update(InstrumentVoucherEntity entity) { super.update(entity); return entity; } }
InstrumentVoucherJdbcRepository extends JdbcRepository { public InstrumentVoucherEntity update(InstrumentVoucherEntity entity) { super.update(entity); return entity; } InstrumentVoucherJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); }
InstrumentVoucherJdbcRepository extends JdbcRepository { public InstrumentVoucherEntity update(InstrumentVoucherEntity entity) { super.update(entity); return entity; } InstrumentVoucherJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); @Override void delete(final String tenantId, final String instrumentId); InstrumentVoucherEntity create(InstrumentVoucherEntity entity); InstrumentVoucherEntity update(InstrumentVoucherEntity entity); Pagination<InstrumentVoucher> search(InstrumentVoucherSearch domain); InstrumentVoucherEntity findById(InstrumentVoucherEntity entity); }
InstrumentVoucherJdbcRepository extends JdbcRepository { public InstrumentVoucherEntity update(InstrumentVoucherEntity entity) { super.update(entity); return entity; } InstrumentVoucherJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); @Override void delete(final String tenantId, final String instrumentId); InstrumentVoucherEntity create(InstrumentVoucherEntity entity); InstrumentVoucherEntity update(InstrumentVoucherEntity entity); Pagination<InstrumentVoucher> search(InstrumentVoucherSearch domain); InstrumentVoucherEntity findById(InstrumentVoucherEntity entity);  }