Skip to content

Commit

Permalink
bump db-model +
Browse files Browse the repository at this point in the history
- refactors value-conversion to TreeSet into the SOS to avoid messing
with Hibernate entity dirty checking

related to:
52North/sensorweb-server-db-model@fefd765
  • Loading branch information
SpeckiJ committed Jan 25, 2024
1 parent e72b869 commit 63c9539
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import java.net.URI;
import java.net.URISyntaxException;
import java.util.TreeSet;

import org.n52.janmayen.NcName;
import org.n52.series.db.beans.BlobDataEntity;
Expand Down Expand Up @@ -148,7 +149,7 @@ public SweCategory visit(CategoryDataEntity o) throws CodedException {
public SweDataRecord visit(ComplexDataEntity o)
throws OwsExceptionReport {
SweDataRecord record = new SweDataRecord();
for (DataEntity<?> sub : o.getValue()) {
for (DataEntity<?> sub : new TreeSet<>(o.getValue())) {
String fieldName = getFieldName(sub);
record.addField(new SweField(fieldName, this.visit(sub)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

import org.hibernate.Session;
import org.joda.time.DateTime;
Expand Down Expand Up @@ -166,23 +167,24 @@ private String createResultValuesFromObservations(final Collection<DataEntity<?>
.next() instanceof TrajectoryDataEntity) {
size = 0;
for (DataEntity<?> observation : observations) {
size += ((TrajectoryDataEntity) observation).getValue()
.size();
size += ((TrajectoryDataEntity) observation).getValue().size();
}
}
addElementCount(builder, size, blockSeparator);
}
for (final DataEntity<?> obs : observations) {
DataEntity<?> observation = unproxy(obs, session);
if (observation instanceof ProfileDataEntity) {
builder.append(createResultValuesFromObservations(((ProfileDataEntity) observation).getValue(),
TreeSet<DataEntity<?>> val = new TreeSet<>(((ProfileDataEntity) observation).getValue());
builder.append(createResultValuesFromObservations(val,
sosResultEncoding, sosResultStructure, noDataPlaceholder, valueOrder, false,
((ProfileDataEntity) observation).getDataset()
.getVerticalMetadata(),
session));
builder.append(blockSeparator);
} else if (observation instanceof TrajectoryDataEntity) {
builder.append(createResultValuesFromObservations(((TrajectoryDataEntity) observation).getValue(),
TreeSet<DataEntity<?>> val = new TreeSet<>(((TrajectoryDataEntity) observation).getValue());
builder.append(createResultValuesFromObservations(val,
sosResultEncoding, sosResultStructure, noDataPlaceholder, valueOrder, false, null,
session));
builder.append(blockSeparator);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<version.n52.common.xml>2.7.0</version.n52.common.xml>
<version.arctic-sea>10.1.1</version.arctic-sea>
<version.helgoland.api>3.5.1</version.helgoland.api>
<version.db-model>4.0.1</version.db-model>
<version.db-model>4.0.3</version.db-model>
<version.dao-impl>4.0.5</version.dao-impl>
<version.helgoland-adapters>2.0.1</version.helgoland-adapters>
<version.springframework>5.3.24</version.springframework>
Expand Down

0 comments on commit 63c9539

Please sign in to comment.