Skip to content

Commit

Permalink
Merge pull request 52North#306 from ridoo/fix/issue_305-broken-servic…
Browse files Browse the repository at this point in the history
…es-and-datasets-collections

apply pkid projection for datasets
  • Loading branch information
ridoo authored Mar 8, 2017
2 parents 3056672 + 5341d30 commit 27b3eb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public abstract class HierarchicalParameterRepository<E extends HierarchicalEntity<E>, O> extends SessionAwareRepository implements OutputAssembler<O> {

// TODO introduce lambdas here

protected List<O> createExpanded(Collection<E> entities, DbQuery parameters) throws DataAccessException {
Set<O> results = new HashSet<>();
if (entities != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,10 @@ private Type getGeometryType(String geometryType) {

public Criteria addDetachedFilters(String propertyName, Criteria criteria) {
DetachedCriteria filter = DetachedCriteria.forClass(DatasetEntity.class)
.setProjection(projectionList().add(property(propertyName)));
.setProjection(projectionList()
.add(Property.forName(propertyName != null && !propertyName.isEmpty()
? propertyName
: "pkid")));

filterWithSingularParmameters(filter); // stay backwards compatible
addFilterRestriction(parameters.getPhenomena(), "phenomenon", filter);
Expand Down

0 comments on commit 27b3eb5

Please sign in to comment.