Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/sinfo/importitem/InfrastructureSeriesImport.java @ 9659:75bd347147ad
Importer (s/u-info) extensions: infrastructures: detecting, logging, cancelling in case of wrong column titles,
detecting, logging and skipping lines with duplicate km+bank
author | mschaefer |
---|---|
date | Mon, 23 Mar 2020 15:37:37 +0100 |
parents | cedcee24a21a |
children |
comparison
equal
deleted
inserted
replaced
9658:d86c7cb68b41 | 9659:75bd347147ad |
---|---|
77 public Logger getLog() { | 77 public Logger getLog() { |
78 return log; | 78 return log; |
79 } | 79 } |
80 | 80 |
81 @Override | 81 @Override |
82 public List<Infrastructure> querySeriesItem(final Session session, final River river) { | 82 public List<Infrastructure> querySeriesItem(final Session session, final River river, final boolean doQueryParent) { |
83 final Query query = session.createQuery("FROM Infrastructure WHERE river=:river AND lower(filename)=:filename"); | 83 final Query query = session.createQuery("FROM Infrastructure WHERE river=:river AND lower(filename)=:filename"); |
84 query.setParameter("river", river); | 84 query.setParameter("river", river); |
85 query.setParameter("filename", this.filename.toLowerCase()); | 85 query.setParameter("filename", this.filename.toLowerCase()); |
86 return query.list(); | 86 return query.list(); |
87 } | 87 } |
88 | 88 |
89 | |
90 @Override | 89 @Override |
91 public Infrastructure createSeriesItem(final River river) { | 90 public Infrastructure createSeriesItem(final River river) { |
92 return new Infrastructure(river, this.filename, this.kmrange_info, this.notes, this.type.getPeer(), this.group.getPeer(), this.year, this.provider, | 91 return new Infrastructure(river, this.filename, this.kmrange_info, this.notes, this.type.getPeer(), this.group.getPeer(), this.year, this.provider, |
93 this.evaluation_by); | 92 this.evaluation_by); |
94 } | 93 } |
94 | |
95 @Override | |
96 public boolean addValue(final InfrastructureKmLineImport value) { | |
97 for (final InfrastructureKmLineImport item : this.values) { | |
98 if (item.getStation() != value.getStation()) | |
99 continue; | |
100 if (item.getBankAttribute() == value.getBankAttribute()) | |
101 return false; | |
102 } | |
103 return super.addValue(value); | |
104 } | |
95 } | 105 } |