5 - Spring Boot Tutorial : One to Many relationship | Spring Data | #SpringData #SpringBoot

preview_player
Показать описание
#OneToManyRelationShip #SpringData #SpringBoot

Рекомендации по теме
Комментарии
Автор

Hiiii!!!! Thanks for the video! Its amazing!

Just an update from me.
In Spring Boot, javas 'transient' keyword didnt work (hibernate still queried the transient field) but when I put the @javax.persistence.Transient annotation, it worked as expected.
Thanks again Almighty!

youtubeuser_apxubksh
Автор

I get lazy init error when I try to access the json request
Could not write JSON: failed to lazily initialize a collection of role: com.vive.adpass.domain.Test.testers, could not initialize proxy - no Session; nested exception is failed to lazily initialize a collection of role: com.vive.adpass.domain.Test.testers, could not initialize proxy - no Session (through reference chain:

alfonsosmaldone
Автор

I'm trying to create Spring Boot REST API for employee and department CRUD. Employee(N) - Department(1) relationships. I'm using EntityManager to use persist(), remove(), merge()... and custom DAO CRUD functions like:

public EmployeeDetail employeeDetail);

public EmployeeDetail updateEmployee(EmployeeDetail employeeDetail);

public EmployeeDetail deleteEmployee(String employeeId);

public EmployeeDetail getById(String employeeId);

public List<EmployeeDetail> getByJobId(String jobId);




How to make it work like above line of code you have used in your program since I can't use findOne() function as I haven't used JpaRepository.

My packages looks like:
com.hrm.main
com.hrm.main.controller
com.hrm.main.model
com.hrm.main.service
com.hrm.main.serviceimpl
com.hrm.main.dao
com.hrm.main.daoimpl

p.s. Can you provide me the code?

bipinshrestha
welcome to shbcf.ru