@Test @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) public void test_update() { AccountEntityEntity accountEntity = AccountEntityEntity.builder().code("codeU").name("nameU").active(true).id("1") .accountDetailTypeId(getAccountDetaialType().getId()).description("entity").build(); accountEntity.setTenantId("default"); AccountEntityEntity actualResult = accountEntityJdbcRepository.update(accountEntity); List<Map<String, Object>> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountEntity", new AccountEntityResultExtractor()); Map<String, Object> row = result.get(0); assertThat(row.get("id")).isEqualTo(actualResult.getId()); assertThat(row.get("name")).isEqualTo(actualResult.getName()); assertThat(row.get("code")).isEqualTo(actualResult.getCode()); }
public AccountEntityEntity update(AccountEntityEntity entity) { super.update(entity); return entity; }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity update(AccountEntityEntity entity) { super.update(entity); return entity; } }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity update(AccountEntityEntity entity) { super.update(entity); return entity; } AccountEntityJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity update(AccountEntityEntity entity) { super.update(entity); return entity; } AccountEntityJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); AccountEntityEntity create(AccountEntityEntity entity); AccountEntityEntity update(AccountEntityEntity entity); Pagination<AccountEntity> search(AccountEntitySearch domain); AccountEntityEntity findById(AccountEntityEntity entity); }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity update(AccountEntityEntity entity) { super.update(entity); return entity; } AccountEntityJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); AccountEntityEntity create(AccountEntityEntity entity); AccountEntityEntity update(AccountEntityEntity entity); Pagination<AccountEntity> search(AccountEntitySearch domain); AccountEntityEntity findById(AccountEntityEntity entity);  }