when i want to call email from table contacte in ProductService PRProduct manytomany BuAffiliate OneToMany BUContact i use this methode
Product.getAffiliate().stream()
.map(contact ->{
IdBO idBO3 = new IdBO();
idBO3.setId(contact.getId());
return contactService.getAllContactsByAffiliate(idBO3); })
.forEach(mail -> notificationProcessor.sendEmailWithParams(mail, notificationSender));
when i want to call email from table contacte in ProductService PRProduct OneToMany BuAffiliate OneToMany BUContact i use this methode
//oneToMany
Product.getAffiliate().stream()
.map(contact ->{
IdBO idBO1 = new IdBO();
idBO1.setId(contact.getId());
return contactService.getById(idBO1.getId()).getEmail(); })
.forEach(mail -> notificationProcessor.sendEmailWithParams(mail, notificationSender));
but is not work i dont know why ??