@Test @Sql(scripts = {"/sql/clearAccountEntity.sql"}) public void test_create() { AccountEntityEntity accountEntity = AccountEntityEntity.builder().id("1").code("code").name("name").active(true) .accountDetailTypeId(getAccountDetaialType().getId()).description("entity").build(); accountEntity.setTenantId("default"); AccountEntityEntity actualResult = accountEntityJdbcRepository.create(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()); assertThat(row.get("accountDetailTypeId")).isEqualTo(actualResult.getAccountDetailTypeId()); }
public AccountEntityEntity create(AccountEntityEntity entity) { super.create(entity); return entity; }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity create(AccountEntityEntity entity) { super.create(entity); return entity; } }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity create(AccountEntityEntity entity) { super.create(entity); return entity; } AccountEntityJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); }
AccountEntityJdbcRepository extends JdbcRepository { public AccountEntityEntity create(AccountEntityEntity entity) { super.create(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 create(AccountEntityEntity entity) { super.create(entity); return entity; } AccountEntityJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); AccountEntityEntity create(AccountEntityEntity entity); AccountEntityEntity update(AccountEntityEntity entity); Pagination<AccountEntity> search(AccountEntitySearch domain); AccountEntityEntity findById(AccountEntityEntity entity);  }