I want to ask about Spring Boot and Spring MVC.
- What is the difference between these components and when should I use them?
- How can I use Spring MVC to generate entities from a database?
I want to ask about Spring Boot and Spring MVC.
You can use spring boot to embed a web server into your JAR. So basically you can run a single command (e.g. java -jar yourSpringBoot.jar
) and it will start up the embedded web server and listen on whatever port you configured in the application properties file. Spring MVC is a framework, it allows you to build web applications.
For the database question, I would recommend reading about Hibernate and its spring boot integration.
Spring Boot is a framework for running enterprise applications using a simple, all-in-one tool that can configure, build, and run an application.
Spring MVC is a framework for building said application. It is used to create Web application API endpoints, visualizations, database entities, and other stuff. You can configure and run it with Spring Boot or just use the standard Spring configuration system.
If you want to map entities to a database, you can use Spring MVC and Spring Boot. There are plenty of tutorials online, but the basics is like this:
getXXX
and setXXX
). @Entity
Application
class with @EnableAutoConfiguration
https://docs.spring.io/spring-boot/docs/current/reference/html/howto-data-access.html