1 package de.dlr.shepard.neo4Core.dao;
2
3 import java.util.Map;
4
5 import de.dlr.shepard.mongoDB.StructuredData;
6 import de.dlr.shepard.util.CypherQueryHelper;
7
8 public class StructuredDataDAO extends GenericDAO<StructuredData> {
9
10
11
12
13
14
15
16
17
18 public StructuredData find(long containerId, String oid) {
19 var query = String.format(
20 "MATCH (c:StructuredDataContainer)-[:structureddata_in_container]->(s:StructuredData {oid: $oid}) WHERE ID(c)=%d %s",
21 containerId, CypherQueryHelper.getReturnPart("s"));
22 var results = findByQuery(query, Map.of("oid", oid));
23 return results.iterator().hasNext() ? results.iterator().next() : null;
24 }
25
26 @Override
27 public Class<StructuredData> getEntityType() {
28 return StructuredData.class;
29 }
30 }