Skip to content

Commit

Permalink
Remove commented dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhashinee committed Jan 7, 2025
1 parent 7802f77 commit 264c8fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
<description>WSO2 Data Services Core Bundle</description>

<dependencies>

<!-- <dependency>-->
<!-- <groupId>org.wso2.orbit.org.jongo.wso2</groupId>-->
<!-- <artifactId>jongo</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
Expand Down Expand Up @@ -254,12 +249,6 @@
<groupId>de.undercouch</groupId>
<artifactId>bson4jackson</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.mongodb</groupId>-->
<!-- <artifactId>mongo-java-driver</artifactId>-->
<!-- <version>3.12.7</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
</dependencies>

<build>
Expand Down Expand Up @@ -371,8 +360,6 @@
org.apache.poi.ss.usermodel;version="${poi.orbit.imp.pkg.version}",
org.apache.commons.collections4;version="${commons-collections4.orbit.imp.pkg.version}",
com.mongodb;version="${mongodb-driver-sync.orbit.imp.pkg.version}",
<!-- com.mongodb.util;version="${mongodb-driver-sync.orbit.imp.pkg.version}",-->
<!-- org.jongo;version="${jongo.orbit.imp.pkg.version}",-->
org.wso2.micro.integrator.dataservices.sql.driver;version="${project.version}",
org.wso2.micro.integrator.dataservices.sql.driver.parser;version="${project.version}",
org.wso2.micro.integrator.dataservices.sql.driver.util;version="${project.version}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private MongoClientSettings extractMongoOptions(Map<String, String> properties,
settingsBuilder.applyToSslSettings(builder -> builder.enabled(true));
}
if (!DBUtils.isEmptyString(writeConcern)) {
settingsBuilder.writeConcern(WriteConcern.valueOf(writeConcern.toUpperCase()));
settingsBuilder.writeConcern(WriteConcern.valueOf(writeConcern));
}
if (!DBUtils.isEmptyString(readPref)) {
settingsBuilder.readPreference(ReadPreference.valueOf(readPref));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,12 @@ public List<ODataEntry> streamTableWithOrder(String tableName, OrderByOption ord
limit.put("$limit", this.chunkSize);
stages.add(limit);

List<Bson> pipeline = Arrays.asList(
Aggregates.match(new Document("status", "active")),
Aggregates.group("$category", Accumulators.sum("count", 1))
);
MongoCursor<Document> iterator = readResult.aggregate(pipeline).iterator();
// List<Bson> pipeline = Arrays.asList(
// Aggregates.match(new Document("status", "active")),
// Aggregates.group("$category", Accumulators.sum("count", 1))
// );
// MongoCursor<Document> iterator = readResult.aggregate(pipeline).iterator();
MongoCursor<Document> iterator = readResult.aggregate(stages).iterator();
return readStreamResultSet(tableName, iterator);
}

Expand Down Expand Up @@ -422,8 +423,8 @@ public boolean updateEntityInTable(String tableName, ODataEntry newProperties) t
if (result.getMatchedCount() == 1) {
return result.wasAcknowledged();
} else {
throw new RuntimeException("Document ID: " + newPropertyObjectKeyValue
+ " does not exist in the collection.");
throw new ODataServiceFault("Document ID: " + newPropertyObjectKeyValue
+ " does not exist in the collection " + tableName + ".");
}
}

Expand Down

0 comments on commit 264c8fc

Please sign in to comment.