1 package org.simantics.db.layer0.validation;
3 import java.util.HashSet;
6 import org.simantics.db.ReadGraph;
7 import org.simantics.db.Resource;
8 import org.simantics.db.common.request.ResourceRead;
9 import org.simantics.db.exception.DatabaseException;
10 import org.simantics.layer0.Layer0;
12 public class GetConstraints extends ResourceRead<Set<Resource>> {
14 public GetConstraints(Resource resource) {
19 public Set<Resource> perform(ReadGraph graph) throws DatabaseException {
21 Layer0 L0 = Layer0.getInstance(graph);
22 HashSet<Resource> result = new HashSet<Resource>();
23 for(Resource type : graph.getTypes(resource)) {
24 result.addAll(graph.getObjects(type, L0.HasConstraint));