What does the EntityManager manage in a JPA application?
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: "Entity lifecycle and persistence". EntityManager là API trung tâm của JPA, gắn với một persistence context (ngữ cảnh lưu trữ): nó đưa thực thể qua các trạng thái new, managed, detached, removed bằng persist, merge, detach, remove, tìm thực thể bằng find, tạo truy vấn JPQL, và đồng bộ thay đổi xuống cơ sở dữ liệu khi flush hoặc commit nhờ dirty checking. "User sessions" là phiên HTTP do servlet container và HttpSession quản lý, không phải việc của tầng persistence. "Network connections" sai vì kết nối cơ sở dữ liệu do DataSource và connection pool như HikariCP lo, EntityManager chỉ dùng chúng. "Web page rendering" là việc của view như Thymeleaf, nằm ở tầng hiển thị chứ không ở tầng dữ liệu.
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