Package com.github.dozermapper.core
Class MappedFieldsTracker
- java.lang.Object
-
- com.github.dozermapper.core.MappedFieldsTracker
-
public class MappedFieldsTracker extends Object
Keeps track of mapped object during this mapping process execution. Objects, which are referenced multiple types in object hierarchy will be fetched from here to retain referential integrity of resulting object graph.
-
-
Constructor Summary
Constructors Constructor Description MappedFieldsTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommitTransaction(Integer txId)Commit transaction with the given ID.ObjectgetMappedValue(Object src, Class<?> destType)ObjectgetMappedValue(Object src, Class<?> destType, String mapId)booleanhasTransaction()Checks if there is a transaction active.voidput(Object src, Object dest)voidput(Object src, Object dest, String mapId)voidrollbackTransaction(Integer txId)Rollback transaction with the given ID.IntegerstartTransaction()Start a new transaction which supports commit or rollback.
-
-
-
Method Detail
-
startTransaction
public Integer startTransaction()
Start a new transaction which supports commit or rollback. Nested transaction are also supported and may be individually rollbacked. Even if nested transactions are commited they may still be rollbacked by the rollback of an outer transaction until the root transaction is committed as well.- Returns:
- transaction ID that can be used for commit or rollback of the transaction
- See Also:
commitTransaction(Integer),rollbackTransaction(Integer)
-
commitTransaction
public void commitTransaction(Integer txId)
Commit transaction with the given ID. The operations executed under this transaction my still be reverted by the rollback of a parent transaction (if any).- Parameters:
txId- - transaction ID as returned bystartTransaction()
-
rollbackTransaction
public void rollbackTransaction(Integer txId)
Rollback transaction with the given ID. The operations of this transactions as well as those of nested transactions are reverted.- Parameters:
txId- - transaction ID as returned bystartTransaction()
-
hasTransaction
public boolean hasTransaction()
Checks if there is a transaction active.- Returns:
trueif a transaction is active,falseotherwise
-
-