I Create one entity with Lazy Loading configuration
@Entity
public class Protocolo {
@OneToMany(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
@JoinColumn(name="protocolo_id")
@JsonIgnore
Set<IntimacaoProtocolo> intimacao;
}
but I in some part of my code I need to access he after a find and I get the
Protocolo myProtocolo = myRepo.findById(1);
myProtocolo.getIntimacao()
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: br.com.exmart.rtdpjlite.model.Protocolo.checklist, could not initialize proxy - no Session
How can I fix this? because in Spring-boot default works fine