@Entity
public class Contact {
...
@OneToMany(mappedBy="contact", targetEntity=Tag.class, fetch=FetchType.EAGER)
private Listtags;
...
}
On first look, when you fetching contacts, their 'tags' fields should be already prepopulated... as they annotated as eager... But then you'll try to execute something like:
requestFactory.contactRequest().findAllContacts().fire(lastDataReceiver);
all 'tags' will be NULL.
To fetch collection fields together with parent entity you have to use:
requestFactory.contactRequest().findAllContacts().with("tags").fire(lastDataReceiver);
Комментариев нет:
Отправить комментарий