@Test @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) public void test_find_by_id() { InstrumentAccountCodeEntity instrumentAccountCodeEntity = InstrumentAccountCodeEntity.builder().id("1").build(); instrumentAccountCodeEntity.setTenantId("default"); InstrumentAccountCodeEntity result = instrumentAccountCodeJdbcRepository.findById(instrumentAccountCodeEntity); assertThat(result.getAccountCodeId()).isEqualTo("glcode"); assertThat(result.getInstrumentTypeId()).isEqualTo("name"); }
public InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity) { List<String> list = allIdentitiferFields.get(entity.getClass().getSimpleName()); Map<String, Object> paramValues = new HashMap<>(); for (String s : list) paramValues.put(s, getValue(getField(entity, s), entity)); List<InstrumentAccountCodeEntity> instrumentaccountcodes = namedParameterJdbcTemplate.query( getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class)); if (instrumentaccountcodes.isEmpty()) return null; else return instrumentaccountcodes.get(0); }
InstrumentAccountCodeJdbcRepository extends JdbcRepository { public InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity) { List<String> list = allIdentitiferFields.get(entity.getClass().getSimpleName()); Map<String, Object> paramValues = new HashMap<>(); for (String s : list) paramValues.put(s, getValue(getField(entity, s), entity)); List<InstrumentAccountCodeEntity> instrumentaccountcodes = namedParameterJdbcTemplate.query( getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class)); if (instrumentaccountcodes.isEmpty()) return null; else return instrumentaccountcodes.get(0); } }
InstrumentAccountCodeJdbcRepository extends JdbcRepository { public InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity) { List<String> list = allIdentitiferFields.get(entity.getClass().getSimpleName()); Map<String, Object> paramValues = new HashMap<>(); for (String s : list) paramValues.put(s, getValue(getField(entity, s), entity)); List<InstrumentAccountCodeEntity> instrumentaccountcodes = namedParameterJdbcTemplate.query( getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class)); if (instrumentaccountcodes.isEmpty()) return null; else return instrumentaccountcodes.get(0); } InstrumentAccountCodeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); }
InstrumentAccountCodeJdbcRepository extends JdbcRepository { public InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity) { List<String> list = allIdentitiferFields.get(entity.getClass().getSimpleName()); Map<String, Object> paramValues = new HashMap<>(); for (String s : list) paramValues.put(s, getValue(getField(entity, s), entity)); List<InstrumentAccountCodeEntity> instrumentaccountcodes = namedParameterJdbcTemplate.query( getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class)); if (instrumentaccountcodes.isEmpty()) return null; else return instrumentaccountcodes.get(0); } InstrumentAccountCodeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); InstrumentAccountCodeEntity create(InstrumentAccountCodeEntity entity); InstrumentAccountCodeEntity update(InstrumentAccountCodeEntity entity); InstrumentAccountCodeEntity delete(InstrumentAccountCodeEntity entity); Pagination<InstrumentAccountCode> search(InstrumentAccountCodeSearch domain); InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity); }
InstrumentAccountCodeJdbcRepository extends JdbcRepository { public InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity) { List<String> list = allIdentitiferFields.get(entity.getClass().getSimpleName()); Map<String, Object> paramValues = new HashMap<>(); for (String s : list) paramValues.put(s, getValue(getField(entity, s), entity)); List<InstrumentAccountCodeEntity> instrumentaccountcodes = namedParameterJdbcTemplate.query( getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class)); if (instrumentaccountcodes.isEmpty()) return null; else return instrumentaccountcodes.get(0); } InstrumentAccountCodeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate); InstrumentAccountCodeEntity create(InstrumentAccountCodeEntity entity); InstrumentAccountCodeEntity update(InstrumentAccountCodeEntity entity); InstrumentAccountCodeEntity delete(InstrumentAccountCodeEntity entity); Pagination<InstrumentAccountCode> search(InstrumentAccountCodeSearch domain); InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity);  }