
com.capitalone.dashboard.repository.BinaryArtifactRepositoryImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hygieia-common Show documentation
Show all versions of hygieia-common Show documentation
Core package shared by API layer and Microservices
The newest version!
package com.capitalone.dashboard.repository;
import com.capitalone.dashboard.model.BinaryArtifact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import java.util.Map;
public class BinaryArtifactRepositoryImpl implements BinaryArtifactRepositoryCustom {
@Autowired
MongoTemplate template;
@Override
public Iterable findByAttributes(Map attributes) {
Criteria c = null;
boolean first = true;
for (Map.Entry e : attributes.entrySet()) {
if (first) {
c = Criteria.where(e.getKey()).is(e.getValue());
} else {
c = c.and(e.getKey()).is(e.getValue());
}
first = false;
}
return template.find(new Query(c), BinaryArtifact.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy