-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow accessing the ClientSession programmatively
- Loading branch information
1 parent
bd66b86
commit fa29a6e
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ons/panache/mongodb-panache/runtime/src/main/java/io/quarkus/mongodb/panache/Panache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.quarkus.mongodb.panache; | ||
|
||
import com.mongodb.session.ClientSession; | ||
import io.quarkus.mongodb.panache.runtime.JavaMongoOperations; | ||
|
||
public class Panache { | ||
|
||
public static ClientSession getSession() { | ||
return JavaMongoOperations.INSTANCE.getSession(); | ||
} | ||
|
||
public static ClientSession getSession(Class entityClass) { | ||
return JavaMongoOperations.INSTANCE.getSession(entityClass); | ||
} | ||
} |