@Test public void emptyFilters_test() throws Exception { final List<IndexingExpr> geoFilters = new ArrayList<>(); final List<IndexingExpr> temporalFilters = new ArrayList<>(); final Document actual = adapter.getFilterQuery(geoFilters, temporalFilters); final String expectedString = "{ }"; final Document expected = Document.parse(expectedString); assertEqualMongo(expected, actual); }
public Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters) throws GeoTemporalIndexException { final QueryBuilder builder = QueryBuilder.start(); if(!geoFilters.isEmpty()) { final Document[] geo = getGeoObjs(geoFilters); if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); builder.and(oneOrAnd(geo), oneOrAnd(temporal)); return builder.get(); } else { return oneOrAnd(geo); } } else if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); return oneOrAnd(temporal); } else { return builder.get(); } }
GeoTemporalMongoDBStorageStrategy extends IndexingMongoDBStorageStrategy { public Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters) throws GeoTemporalIndexException { final QueryBuilder builder = QueryBuilder.start(); if(!geoFilters.isEmpty()) { final Document[] geo = getGeoObjs(geoFilters); if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); builder.and(oneOrAnd(geo), oneOrAnd(temporal)); return builder.get(); } else { return oneOrAnd(geo); } } else if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); return oneOrAnd(temporal); } else { return builder.get(); } } }
GeoTemporalMongoDBStorageStrategy extends IndexingMongoDBStorageStrategy { public Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters) throws GeoTemporalIndexException { final QueryBuilder builder = QueryBuilder.start(); if(!geoFilters.isEmpty()) { final Document[] geo = getGeoObjs(geoFilters); if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); builder.and(oneOrAnd(geo), oneOrAnd(temporal)); return builder.get(); } else { return oneOrAnd(geo); } } else if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); return oneOrAnd(temporal); } else { return builder.get(); } } GeoTemporalMongoDBStorageStrategy(); }
GeoTemporalMongoDBStorageStrategy extends IndexingMongoDBStorageStrategy { public Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters) throws GeoTemporalIndexException { final QueryBuilder builder = QueryBuilder.start(); if(!geoFilters.isEmpty()) { final Document[] geo = getGeoObjs(geoFilters); if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); builder.and(oneOrAnd(geo), oneOrAnd(temporal)); return builder.get(); } else { return oneOrAnd(geo); } } else if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); return oneOrAnd(temporal); } else { return builder.get(); } } GeoTemporalMongoDBStorageStrategy(); @Override void createIndices(final MongoCollection<Document> coll); Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters); @Override Document serialize(final RyaStatement ryaStatement); }
GeoTemporalMongoDBStorageStrategy extends IndexingMongoDBStorageStrategy { public Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters) throws GeoTemporalIndexException { final QueryBuilder builder = QueryBuilder.start(); if(!geoFilters.isEmpty()) { final Document[] geo = getGeoObjs(geoFilters); if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); builder.and(oneOrAnd(geo), oneOrAnd(temporal)); return builder.get(); } else { return oneOrAnd(geo); } } else if(!temporalFilters.isEmpty()) { final Document[] temporal = getTemporalObjs(temporalFilters); return oneOrAnd(temporal); } else { return builder.get(); } } GeoTemporalMongoDBStorageStrategy(); @Override void createIndices(final MongoCollection<Document> coll); Document getFilterQuery(final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters); @Override Document serialize(final RyaStatement ryaStatement);  }