Class MorphiaGuiceTransaction
java.lang.Object
dev.getelements.elements.dao.mongo.guice.MorphiaGuiceTransaction
- All Implemented Interfaces:
Transaction
,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes and releases the transaction.void
commit()
Commits the transaction.<DaoT> DaoT
Gets the requested Dao type, bound to thisTransaction
.com.google.inject.Injector
dev.morphia.transactions.MorphiaSession
boolean
isActive()
Returns true if this transaction is still active and open.void
rollback()
Rolls back the transaction.void
setInjector
(com.google.inject.Injector injector) void
setMorphiaSession
(dev.morphia.transactions.MorphiaSession morphiaSession) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.dao.Transaction
performAndClose, performAndCloseV
-
Constructor Details
-
MorphiaGuiceTransaction
public MorphiaGuiceTransaction()
-
-
Method Details
-
getDao
Description copied from interface:Transaction
Gets the requested Dao type, bound to thisTransaction
. The returned DAO is only valid for the life of thisTransaction
object.- Specified by:
getDao
in interfaceTransaction
- Type Parameters:
DaoT
- the DAO Type- Parameters:
daoT
- theClass<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 interfaceTransaction
- 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 interfaceTransaction
-
rollback
public void rollback()Description copied from interface:Transaction
Rolls back the transaction.- Specified by:
rollback
in interfaceTransaction
-
close
public void close()Description copied from interface:Transaction
Closes and releases the transaction.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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)
-