티스토리 뷰

Exception encountered during context initialization - cancelling refresh attempt: 
org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'entityManagerFactory' defined in class path resource 
[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: 
Invocation of init method failed; nested exception is javax.persistence.PersistenceException: 
[PersistenceUnit: default] Unable to build Hibernate SessionFactory; 
nested exception is org.hibernate.loader.MultipleBagFetchException: 
cannot simultaneously fetch multiple bags: 
[com.mindone.okch.inspection.domain.InspLdg.ftrs, 
 com.mindone.okch.inspection.domain.InspLdg.cctvs]

 

	// 조사시설물
	@JsonIgnoreProperties("inspLdg")
	@OneToMany(mappedBy = "inspLdg", cascade = CascadeType.ALL, fetch = FetchType.EAGER) // 20200626 FetchType.LAZY에서 EAGER로 수정 by ljpark XSS적용 위해
	private List<InspFtr> ftrs;
	
	public void setFtrs(List<InspFtr> ftrs) {
		this.ftrs = ftrs;
		for(InspFtr ftr : ftrs)
			ftr.setInspLdg(this);
	}
	

	@JsonIgnoreProperties("inspLdg")  //cctv
	@OneToMany(mappedBy="inspLdg", cascade=CascadeType.ALL, fetch = FetchType.EAGER) // 20200626 FetchType.LAZY에서 EAGER로 수정 by ljpark XSS적용 위해
	private List<Cctv> cctvs;
	
	public void setCctvs(List<Cctv> cctvs) {
		this.cctvs = cctvs;
		
		if(cctvs != null)
			for(Cctv cctv : cctvs)
				cctv.setInspLdg(this);
	}

FetchType.LAZY에서 EAGER로 수정했는데.. MultipleBagFetchException이 발생했다..ㅠㅠ

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함