@Test @Sql(scripts = { "/sql/clearFunction.sql" }) public void test_create() { FunctionEntity function = FunctionEntity.builder().id("46353532").code("code").name("name").active(true) .level(1).parentId("1").build(); function.setTenantId("default"); FunctionEntity actualResult = functionJdbcRepository.create(function); List<Map<String, Object>> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_function", new FunctionResultExtractor()); 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("parentId")).isEqualTo(actualResult.getParentId()); }
public FunctionEntity create(FunctionEntity entity) { super.create(entity); return entity; }
FunctionJdbcRepository extends JdbcRepository { public FunctionEntity create(FunctionEntity entity) { super.create(entity); return entity; } }
FunctionJdbcRepository extends JdbcRepository { public FunctionEntity create(FunctionEntity entity) { super.create(entity); return entity; } FunctionJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); }
FunctionJdbcRepository extends JdbcRepository { public FunctionEntity create(FunctionEntity entity) { super.create(entity); return entity; } FunctionJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); FunctionEntity create(FunctionEntity entity); FunctionEntity update(FunctionEntity entity); Pagination<Function> search(FunctionSearch domain); FunctionEntity findById(FunctionEntity entity); }
FunctionJdbcRepository extends JdbcRepository { public FunctionEntity create(FunctionEntity entity) { super.create(entity); return entity; } FunctionJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate); FunctionEntity create(FunctionEntity entity); FunctionEntity update(FunctionEntity entity); Pagination<Function> search(FunctionSearch domain); FunctionEntity findById(FunctionEntity entity);  }