Sorry but I don’t find in the documentation the right way to load a detached object.
In the last 2 lines of code I tried to obtain the object but I get an error.
Thanks for your help
@Component
public class DocumentoEventListener {
@Autowired
private DataManager dataManager;
@TransactionalEventListener
public void onDocumentoChangedAfterCommit(EntityChangedEvent<Documento> event) {
if (event.getType() == EntityChangedEvent.Type.CREATED) {
//recupero il documento
Documento activeDoc = dataManager.load(event.getEntityId()).joinTransaction(false).one();
TipiPagamento tipoPag = activeDoc.getTipoPagamento();
TipiPagamento tipoPag2 = dataManager.load(activeDoc.getTipoPagamento().getId());