@Test @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql" }) public void test_create() { InstrumentTypeEntity instrumentType = InstrumentTypeEntity.builder().id("1").name("name").description("description") .active(true).build(); instrumentType.setTenantId("default"); InstrumentTypeEntity actualResult = instrumentTypeJdbcRepository.create(instrumentType); List<Map<String, Object>> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentType", new InstrumentTypeResultExtractor()); Map<String, Object> row = result.get(0); assertThat(row.get("name")).isEqualTo(actualResult.getName()); assertThat(row.get("description")).isEqualTo(actualResult.getDescription()); assertThat(row.get("active")).isEqualTo(actualResult.getActive()); }
public InstrumentTypeEntity create(InstrumentTypeEntity entity) { super.create(entity); return entity; }
InstrumentTypeJdbcRepository extends JdbcRepository { public InstrumentTypeEntity create(InstrumentTypeEntity entity) { super.create(entity); return entity; } }
InstrumentTypeJdbcRepository extends JdbcRepository { public InstrumentTypeEntity create(InstrumentTypeEntity entity) { super.create(entity); return entity; } InstrumentTypeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); }
InstrumentTypeJdbcRepository extends JdbcRepository { public InstrumentTypeEntity create(InstrumentTypeEntity entity) { super.create(entity); return entity; } InstrumentTypeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); InstrumentTypeEntity create(InstrumentTypeEntity entity); InstrumentTypeEntity update(InstrumentTypeEntity entity); InstrumentTypeEntity delete(InstrumentTypeEntity entity); Pagination<InstrumentType> search(InstrumentTypeSearch domain); InstrumentTypeEntity findById(InstrumentTypeEntity entity); }
InstrumentTypeJdbcRepository extends JdbcRepository { public InstrumentTypeEntity create(InstrumentTypeEntity entity) { super.create(entity); return entity; } InstrumentTypeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); InstrumentTypeEntity create(InstrumentTypeEntity entity); InstrumentTypeEntity update(InstrumentTypeEntity entity); InstrumentTypeEntity delete(InstrumentTypeEntity entity); Pagination<InstrumentType> search(InstrumentTypeSearch domain); InstrumentTypeEntity findById(InstrumentTypeEntity entity);  }