Class MorphiaGuiceTransaction
java.lang.Object
dev.getelements.elements.dao.mongo.guice.MorphiaGuiceTransaction
- All Implemented Interfaces:
Transaction,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes and releases the transaction.voidcommit()Commits the transaction.<DaoT> DaoTGets the requested Dao type, bound to thisTransaction.com.google.inject.Injectordev.morphia.transactions.MorphiaSessionbooleanisActive()Returns true if this transaction is still active and open.voidrollback()Rolls back the transaction.voidsetInjector(com.google.inject.Injector injector) voidsetMorphiaSession(dev.morphia.transactions.MorphiaSession morphiaSession) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.dao.Transaction
performAndClose, performAndCloseV
-
Constructor Details
-
MorphiaGuiceTransaction
public MorphiaGuiceTransaction()
-
-
Method Details
-
getDao
Description copied from interface:TransactionGets the requested Dao type, bound to thisTransaction. The returned DAO is only valid for the life of thisTransactionobject.- Specified by:
getDaoin interfaceTransaction- Type Parameters:
DaoT- the DAO Type- Parameters:
daoT- theClass<DaoT>- Returns:
- the DAO Instance
-
isActive
public boolean isActive()Description copied from interface:TransactionReturns true if this transaction is still active and open.- Specified by:
isActivein interfaceTransaction- Returns:
- true if active, false if it has been committed or rolled back.
-
commit
public void commit()Description copied from interface:TransactionCommits the transaction.- Specified by:
commitin interfaceTransaction
-
rollback
public void rollback()Description copied from interface:TransactionRolls back the transaction.- Specified by:
rollbackin interfaceTransaction
-
close
public void close()Description copied from interface:TransactionCloses and releases the transaction.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTransaction
-
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)
-