Package io.quarkus.mongodb.panache
Class Panache
java.lang.Object
io.quarkus.mongodb.panache.Panache
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.mongodb.session.ClientSession
Access the current MongoDB ClientSession from the transaction context.static com.mongodb.session.ClientSession
getSession
(Class<?> entityClass) Access the current MongoDB ClientSession from the transaction context.
-
Constructor Details
-
Panache
public Panache()
-
-
Method Details
-
getSession
public static com.mongodb.session.ClientSession getSession()Access the current MongoDB ClientSession from the transaction context. Can be used inside a method annotated with `@Transactional` to manually access the client session.- Returns:
- ClientSession or null if not in the context of a transaction.
-
getSession
Access the current MongoDB ClientSession from the transaction context.- Parameters:
entityClass
- the class of the MongoDB entity in case it is configured to use the non-default client.- Returns:
- ClientSession or null if not in the context of a transaction.
- See Also:
-