What is the purpose of the EntityManager in JPA?
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "To manage persistent entities.". EntityManager là giao diện JPA gắn với một persistence context, tập các entity đang ở trạng thái managed; nó cung cấp persist, find, merge, remove, refresh, detach, flush và createQuery, đồng thời theo dõi thay đổi trên các entity managed để tự đồng bộ xuống cơ sở dữ liệu khi flush hoặc commit giao dịch. Trong Spring, EntityManager được tiêm bằng @PersistenceContext và các repository của Spring Data JPA cũng gọi nó bên dưới. "To manage application configurations." là việc của Environment và cơ chế properties của Spring Boot. "To handle user authentication." là việc của Spring Security với AuthenticationManager. "To create user interfaces." thuộc tầng hiển thị như Thymeleaf hay JavaFX, không phải tầng lưu trữ.
Cùng phần 1
If you have a Student entity and a Course entity with a Many-to-Many relationship, and you want to fetch all students enrolled in a specific course, how would you typically structure the query in JPA?Có lời giảiCâu hỏiWhich annotation is used to define a JPA Many-to-Many relationship?Có lời giảiCâu hỏiWhat is the purpose of the @Column annotation in JPA?Có lời giảiCâu hỏiCả 40 câu của chủ đề40 câu
Xuất hiện trong 1 bộ đề
Đi tiếp từ đây