Class Panache

java.lang.Object
io.quarkus.mongodb.panache.Panache

public class Panache extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.mongodb.client.ClientSession
    Access the current MongoDB ClientSession from the transaction context.
    static com.mongodb.client.ClientSession
    getSession(Class<?> entityClass)
    Access the current MongoDB ClientSession from the transaction context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Panache

      public Panache()
  • Method Details

    • getSession

      public static com.mongodb.client.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

      public static com.mongodb.client.ClientSession getSession(Class<?> entityClass)
      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: