Which dependency is essential in pom.xml to enable Spring Data 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: "spring-boot-starter-data-jpa". Starter này kéo theo Spring Data JPA, Hibernate làm JPA provider, spring-jdbc và HikariCP làm connection pool; khi thấy chúng trên classpath cùng thông tin spring.datasource, auto-configuration tự dựng DataSource, EntityManagerFactory, transaction manager và bật quét các interface repository. "spring-boot-starter-web" dùng cho Spring MVC và Tomcat nhúng, không chứa JPA. "spring-boot-starter-test" cung cấp JUnit, Mockito, AssertJ cho kiểm thử, thường đặt ở phạm vi test. "spring-boot-devtools" chỉ hỗ trợ lúc phát triển như tự khởi động lại và LiveReload, không thêm khả năng truy cập dữ liệu. Ngoài starter này vẫn cần driver của cơ sở dữ liệu cụ thể như mysql-connector-j, nhưng đó là phần bổ sung chứ không phải thứ bật Spring Data JPA.
Cùng phần 3
Which annotation is used to define a Spring Boot main class?
@SpringBootApplication
public class AppStarter {
public static void main(String[] args) {
SpringApplication.run(AppStarter.class, args);
}
}Có lời giảiCâu hỏiWhich component provides automatic restart and LiveReload to speed up development?Có lời giảiCâu hỏiWhat is the benefit of Spring Boot's embedded servers?Có lời giảiCâu hỏiCả 18 câu của chủ đề18 câu
Xuất hiện trong 1 bộ đề
Đi tiếp từ đây