Class MorphiaGuiceTransaction

java.lang.Object
dev.getelements.elements.dao.mongo.guice.MorphiaGuiceTransaction
All Implemented Interfaces:
Transaction, AutoCloseable

public class MorphiaGuiceTransaction extends Object implements Transaction
  • Constructor Details

    • MorphiaGuiceTransaction

      public MorphiaGuiceTransaction()
  • Method Details

    • getDao

      public <DaoT> DaoT getDao(Class<DaoT> daoT)
      Description copied from interface: Transaction
      Gets the requested Dao type, bound to this Transaction. The returned DAO is only valid for the life of this Transaction object.
      Specified by:
      getDao in interface Transaction
      Type Parameters:
      DaoT - the DAO Type
      Parameters:
      daoT - the Class<DaoT>
      Returns:
      the DAO Instance
    • isActive

      public boolean isActive()
      Description copied from interface: Transaction
      Returns true if this transaction is still active and open.
      Specified by:
      isActive in interface Transaction
      Returns:
      true if active, false if it has been committed or rolled back.
    • commit

      public void commit()
      Description copied from interface: Transaction
      Commits the transaction.
      Specified by:
      commit in interface Transaction
    • rollback

      public void rollback()
      Description copied from interface: Transaction
      Rolls back the transaction.
      Specified by:
      rollback in interface Transaction
    • close

      public void close()
      Description copied from interface: Transaction
      Closes and releases the transaction.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Transaction
    • getInjector

      public com.google.inject.Injector getInjector()
    • setInjector

      @Inject public void setInjector(com.google.inject.Injector injector)
    • getMorphiaSession

      public dev.morphia.transactions.MorphiaSession getMorphiaSession()
    • setMorphiaSession

      @Inject public void setMorphiaSession(dev.morphia.transactions.MorphiaSession morphiaSession)