X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FDependenciesRelation.java;fp=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FDependenciesRelation.java;h=e300384f1f686ac3c874d2a17e8046399f1ce0cf;hp=033efc9cc007d859a4ceb458f88284082cc9d302;hb=5e340942bc7de041b75c6ba281617eb0c800f30a;hpb=69e1a2ba724ffadd5227d13f97eb0d9100068804 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java index 033efc9cc..e300384f1 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java @@ -77,7 +77,9 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic Pair.make(Dependencies.FIELD_RESOURCE, "Long"), Pair.make(Dependencies.FIELD_NAME, "String"), Pair.make(Dependencies.FIELD_TYPES, "Text"), - Pair.make(Dependencies.FIELD_GUID, "Text") + Pair.make(Dependencies.FIELD_GUID, "Text"), + Pair.make(Dependencies.FIELD_NAME_SEARCH, "Text"), + Pair.make(Dependencies.FIELD_TYPES_SEARCH, "Text") }; final Resource resource; @@ -233,7 +235,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic ArrayList result = new ArrayList(); for (Entry entry : entries) { if(entry.name == null) continue; - result.add(new Object[] { ss.getRandomAccessId(entry.parent), ss.getRandomAccessId(entry.resource), entry.name, entry.types, entry.id }); + result.add(new Object[] { ss.getRandomAccessId(entry.parent), ss.getRandomAccessId(entry.resource), entry.name, entry.types, entry.id, entry.name, entry.types }); } return result; @@ -249,21 +251,21 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic @Override public List> query(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount) { - if(!Dependencies.getBindingPattern().equals(bindingPattern)) throw new IllegalArgumentException("DependenciesRelation supports indexing only with 'bfffff'"); + if(!Dependencies.getBindingPattern().equals(bindingPattern)) throw new IllegalArgumentException("DependenciesRelation supports indexing only with 'bfffffff'"); IndexedRelations indexer = session.getService(IndexedRelations.class); return indexer.query(null, search, session, resource, (Resource)constants[0], maxResultCount); } @Override public List queryResources(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount) { - if(!Dependencies.getBindingPattern().equals(bindingPattern)) throw new IllegalArgumentException("DependenciesRelation supports indexing only with 'bfffff'"); + if(!Dependencies.getBindingPattern().equals(bindingPattern)) throw new IllegalArgumentException("DependenciesRelation supports indexing only with 'bfffffff'"); IndexedRelations indexer = session.getService(IndexedRelations.class); return indexer.queryResources(null, search, session, resource, (Resource)constants[0], maxResultCount); } @Override public List> list(RequestProcessor session, String bindingPattern, Object[] constants, int maxResultCount) { - if(!Dependencies.getBindingPattern().equals(bindingPattern)) throw new IllegalArgumentException("DependenciesRelation supports indexing only with 'bfffff'"); + if(!Dependencies.getBindingPattern().equals(bindingPattern)) throw new IllegalArgumentException("DependenciesRelation supports indexing only with 'bfffffff'"); IndexedRelations indexer = session.getService(IndexedRelations.class); return indexer.query(null, null, session, resource, (Resource)constants[0], maxResultCount); } @@ -417,7 +419,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic if(!entry.isValid(graph)) continue; Resource parent = graph.getPossibleObject(entry.component, L0.PartOf); if (parent != null) { - _additions.add(new Object[] { ss.getRandomAccessId(parent), ss.getRandomAccessId(entry.component), name, types, id != null ? id.indexString() : "" }); + _additions.add(new Object[] { ss.getRandomAccessId(parent), ss.getRandomAccessId(entry.component), name, types, id != null ? id.indexString() : "", name, types}); } else { //LOGGER.info("resource " + entry.component + ": no parent for entry " + name + " " + types); } @@ -438,7 +440,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic if(part != null) { _replacementKeys.add(ss.getRandomAccessId(entry.component)); _replacementObjects.add(new Object[] { ss.getRandomAccessId(part), - ss.getRandomAccessId(entry.component), name, types, id != null ? id.indexString() : "" }); + ss.getRandomAccessId(entry.component), name, types, id != null ? id.indexString() : "", name, types}); } } } @@ -622,7 +624,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic ArrayList result = new ArrayList(entries.size()); for (Entry entry : entries) { - result.add(new Object[] { ss.getRandomAccessId(entry.parent), ss.getRandomAccessId(entry.resource), entry.name, entry.types, entry.id }); + result.add(new Object[] { ss.getRandomAccessId(entry.parent), ss.getRandomAccessId(entry.resource), entry.name, entry.types, entry.id, entry.name, entry.types }); } Layer0X L0X = Layer0X.getInstance(graph);