removed stationReihenfolge database table, because its not needed

This commit is contained in:
Michael 2019-04-07 14:06:41 +02:00
parent 3d78f0bc42
commit e86aa6adc2
3 changed files with 0 additions and 77 deletions

View File

@ -40,9 +40,6 @@ public class Controller {
@Autowired
UserRepository userRepository;
@Autowired
StationReihenfolgeRepository stationReihenfolgeRepository;
private AtomicLong counter = new AtomicLong();
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@ -177,14 +174,6 @@ public class Controller {
cacheRepository.save(cache);
for (int i = 0; i + 1 < cache.getStationen().size(); i++) {
StationReihenfolge stationReihenfolge = new StationReihenfolge();
stationReihenfolge.setCache(cache);
stationReihenfolge.setStation(cache.getStationen().get(i));
stationReihenfolge.setNachfolgeStation(cache.getStationen().get(i + 1));
stationReihenfolgeRepository.save(stationReihenfolge);
}
return ResponseEntity.status(200).body(new Gson().toJson(cache));
}
@ -270,12 +259,6 @@ public class Controller {
Cache cache = optionalCache.get();
for (StationReihenfolge stationReihenfolge : stationReihenfolgeRepository.findAll()) {
if (stationReihenfolge.getCache().getId() == cache.getId()) {
stationReihenfolgeRepository.delete(stationReihenfolge);
}
}
for (Bearbeitet bearbeitet : bearbeitetRepository.findAll()) {
if (bearbeitet.getCache().getId() == cache.getId()) {
bearbeitetRepository.delete(bearbeitet);

View File

@ -1,53 +0,0 @@
package hhn.labsw.bugageocaching.entities;
import javax.persistence.*;
@Entity
@Table
public class StationReihenfolge {
@Id
@GeneratedValue
private int id;
@OneToOne
private Cache cache;
@OneToOne
private Station station;
@OneToOne
private Station nachfolgeStation;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Cache getCache() {
return cache;
}
public void setCache(Cache cache) {
this.cache = cache;
}
public Station getStation() {
return station;
}
public void setStation(Station station) {
this.station = station;
}
public Station getNachfolgeStation() {
return nachfolgeStation;
}
public void setNachfolgeStation(Station nachfolgeStation) {
this.nachfolgeStation = nachfolgeStation;
}
}

View File

@ -1,7 +0,0 @@
package hhn.labsw.bugageocaching.repositories;
import hhn.labsw.bugageocaching.entities.StationReihenfolge;
import org.springframework.data.repository.CrudRepository;
public interface StationReihenfolgeRepository extends CrudRepository<StationReihenfolge, Integer> {
}