Skip to content

Commit

Permalink
Update mongodb-driver-sync and annotations
Browse files Browse the repository at this point in the history
mongodv-driver-sync: 5.1.4 -> 5.2.0
annotations: 24.1.0 -> 25.0.0
  • Loading branch information
srnyx committed Sep 28, 2024
1 parent e5e3c1e commit 240a99c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ setupJava("xyz.srnyx", "1.2.2", "Common framework for srnyx's MongoDB management

repository(Repository.MAVEN_CENTRAL)
dependencies {
implementation("org.mongodb", "mongodb-driver-sync", "5.1.4")
compileOnly("org.jetbrains" , "annotations", "24.1.0")
implementation("org.mongodb", "mongodb-driver-sync", "5.2.0")
compileOnly("org.jetbrains" , "annotations", "25.0.0")
}

setupPublishing(
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/xyz/srnyx/magicmongo/MagicCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;


/**
Expand Down Expand Up @@ -448,6 +449,10 @@ public WriteConcern getWriteConcern() {
public ReadConcern getReadConcern() {
return collection.getReadConcern();
}
@Override @Nullable
public Long getTimeout(@NotNull TimeUnit timeUnit) {
return collection.getTimeout(timeUnit);
}
@Override @NotNull
public <N> MongoCollection<N> withDocumentClass(@NotNull Class<N> clazz) {
return collection.withDocumentClass(clazz);
Expand All @@ -468,6 +473,10 @@ public MongoCollection<T> withWriteConcern(@NotNull WriteConcern writeConcern) {
public MongoCollection<T> withReadConcern(@NotNull ReadConcern readConcern) {
return collection.withReadConcern(readConcern);
}
@Override @NotNull
public MongoCollection<T> withTimeout(long timeout, @NotNull TimeUnit timeUnit) {
return collection.withTimeout(timeout, timeUnit);
}
@Override
public long countDocuments() {
return collection.countDocuments();
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/xyz/srnyx/magicmongo/MagicDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
import org.bson.conversions.Bson;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;


/**
Expand Down Expand Up @@ -145,6 +147,10 @@ public WriteConcern getWriteConcern() {
public ReadConcern getReadConcern() {
return database.getReadConcern();
}
@Override @Nullable
public Long getTimeout(@NotNull TimeUnit timeUnit) {
return database.getTimeout(timeUnit);
}
@Override @NotNull
public MongoDatabase withCodecRegistry(@NotNull CodecRegistry codecRegistry) {
return database.withCodecRegistry(codecRegistry);
Expand All @@ -162,6 +168,10 @@ public MongoDatabase withReadConcern(@NotNull ReadConcern readConcern) {
return database.withReadConcern(readConcern);
}
@Override @NotNull
public MongoDatabase withTimeout(long timeout, @NotNull TimeUnit timeUnit) {
return database.withTimeout(timeout, timeUnit);
}
@Override @NotNull
public MongoCollection<Document> getCollection(@NotNull String collectionName) {
return database.getCollection(collectionName);
}
Expand Down

0 comments on commit 240a99c

Please sign in to comment.