@Test @Sql(scripts = { "/sql/budgetdetail/clearBudgetDetail.sql", "/sql/budgetdetail/insertBudgetDetailData.sql" }) public void test_update() { BudgetDetailEntity budgetDetail = BudgetDetailEntity.builder().anticipatoryAmount(BigDecimal.ONE) .approvedAmount(BigDecimal.ONE).budgetAvailable(BigDecimal.ONE).originalAmount(BigDecimal.ONE) .budgetId("1").budgetGroupId("1").planningPercent(BigDecimal.valueOf(1500)).id("1").build(); budgetDetail.setTenantId("default"); BudgetDetailEntity actualResult = budgetDetailJdbcRepository.update(budgetDetail); List<Map<String, Object>> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_budgetdetail", new BudgetDetailResultExtractor()); Map<String, Object> row = result.get(0); assertThat(row.get("id")).isEqualTo(actualResult.getId()); assertThat(row.get("anticipatoryAmount")).isEqualTo(actualResult.getAnticipatoryAmount().intValue()); assertThat(row.get("approvedAmount")).isEqualTo(actualResult.getApprovedAmount().intValue()); assertThat(row.get("budgetAvailable")).isEqualTo(actualResult.getBudgetAvailable().intValue()); assertThat(row.get("originalAmount")).isEqualTo(actualResult.getOriginalAmount().intValue()); }
public BudgetDetailEntity update(final BudgetDetailEntity entity) { super.update(entity); return entity; }
BudgetDetailJdbcRepository extends JdbcRepository { public BudgetDetailEntity update(final BudgetDetailEntity entity) { super.update(entity); return entity; } }
BudgetDetailJdbcRepository extends JdbcRepository { public BudgetDetailEntity update(final BudgetDetailEntity entity) { super.update(entity); return entity; } BudgetDetailJdbcRepository(final NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); }
BudgetDetailJdbcRepository extends JdbcRepository { public BudgetDetailEntity update(final BudgetDetailEntity entity) { super.update(entity); return entity; } BudgetDetailJdbcRepository(final NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); BudgetDetailEntity create(final BudgetDetailEntity entity); BudgetDetailEntity update(final BudgetDetailEntity entity); BudgetDetailEntity delete(final BudgetDetailEntity entity); Pagination<BudgetDetail> search(final BudgetDetailSearch domain); BudgetDetailEntity findById(final BudgetDetailEntity entity); }
BudgetDetailJdbcRepository extends JdbcRepository { public BudgetDetailEntity update(final BudgetDetailEntity entity) { super.update(entity); return entity; } BudgetDetailJdbcRepository(final NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); BudgetDetailEntity create(final BudgetDetailEntity entity); BudgetDetailEntity update(final BudgetDetailEntity entity); BudgetDetailEntity delete(final BudgetDetailEntity entity); Pagination<BudgetDetail> search(final BudgetDetailSearch domain); BudgetDetailEntity findById(final BudgetDetailEntity entity);  }