mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
small cosmetic changes
This commit is contained in:
parent
3ee5e912ee
commit
ea3057f7af
4 changed files with 0 additions and 12 deletions
|
@ -25,7 +25,6 @@ public class JdbcOwnerRepositoryExtImpl extends JdbcOwnerRepositoryImpl implemen
|
||||||
@Autowired
|
@Autowired
|
||||||
public JdbcOwnerRepositoryExtImpl(DataSource dataSource) {
|
public JdbcOwnerRepositoryExtImpl(DataSource dataSource) {
|
||||||
super(dataSource);
|
super(dataSource);
|
||||||
// TODO super() ?
|
|
||||||
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
|
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,6 @@ public class JdbcPetTypeRepositoryExtImpl implements PetTypeRepositoryExt {
|
||||||
this.namedParameterJdbcTemplate.update("UPDATE types SET name=:name WHERE id=:id",
|
this.namedParameterJdbcTemplate.update("UPDATE types SET name=:name WHERE id=:id",
|
||||||
parameterSource);
|
parameterSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,7 +77,6 @@ public class JdbcPetTypeRepositoryExtImpl implements PetTypeRepositoryExt {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("id", petType.getId());
|
params.put("id", petType.getId());
|
||||||
this.namedParameterJdbcTemplate.update("DELETE FROM types WHERE id=:id", params);
|
this.namedParameterJdbcTemplate.update("DELETE FROM types WHERE id=:id", params);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,7 @@ public class JdbcSpecialtyRepositoryExtImpl implements SpecialtyRepositoryExt {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public JdbcSpecialtyRepositoryExtImpl(DataSource dataSource) {
|
public JdbcSpecialtyRepositoryExtImpl(DataSource dataSource) {
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
|
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
|
||||||
|
|
||||||
this.insertSpecialty = new SimpleJdbcInsert(dataSource)
|
this.insertSpecialty = new SimpleJdbcInsert(dataSource)
|
||||||
.withTableName("specialties")
|
.withTableName("specialties")
|
||||||
.usingGeneratedKeyColumns("id");
|
.usingGeneratedKeyColumns("id");
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
|
||||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
|
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
|
||||||
import org.springframework.orm.ObjectRetrievalFailureException;
|
import org.springframework.orm.ObjectRetrievalFailureException;
|
||||||
import org.springframework.samples.petclinic.model.Owner;
|
|
||||||
import org.springframework.samples.petclinic.model.Vet;
|
import org.springframework.samples.petclinic.model.Vet;
|
||||||
import org.springframework.samples.petclinic.repository.VetRepositoryExt;
|
import org.springframework.samples.petclinic.repository.VetRepositoryExt;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
@ -24,8 +23,6 @@ import org.springframework.stereotype.Repository;
|
||||||
@Qualifier("VetRepositoryExt")
|
@Qualifier("VetRepositoryExt")
|
||||||
public class JdbcVetRepositoryExtImpl extends JdbcVetRepositoryImpl implements VetRepositoryExt {
|
public class JdbcVetRepositoryExtImpl extends JdbcVetRepositoryImpl implements VetRepositoryExt {
|
||||||
|
|
||||||
//private JdbcTemplate jdbcTemplate;
|
|
||||||
|
|
||||||
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
private SimpleJdbcInsert insertVet;
|
private SimpleJdbcInsert insertVet;
|
||||||
|
@ -33,13 +30,9 @@ public class JdbcVetRepositoryExtImpl extends JdbcVetRepositoryImpl implements V
|
||||||
@Autowired
|
@Autowired
|
||||||
public JdbcVetRepositoryExtImpl(DataSource dataSource, JdbcTemplate jdbcTemplate) {
|
public JdbcVetRepositoryExtImpl(DataSource dataSource, JdbcTemplate jdbcTemplate) {
|
||||||
super(jdbcTemplate);
|
super(jdbcTemplate);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
//this.jdbcTemplate = jdbcTemplate;
|
|
||||||
|
|
||||||
this.insertVet = new SimpleJdbcInsert(dataSource)
|
this.insertVet = new SimpleJdbcInsert(dataSource)
|
||||||
.withTableName("vets")
|
.withTableName("vets")
|
||||||
.usingGeneratedKeyColumns("id");
|
.usingGeneratedKeyColumns("id");
|
||||||
|
|
||||||
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
|
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue