In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to add Spring-Data-Jpa support, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
JPA: (Java Persistence API): provides a standard ORM mapping solution, which is the specification for Java to manipulate POJO persistence. Hibernate conforms to the JPA specification.
Spring-Data-Jpa: Spring's support for the JPA framework to simplify the persistence layer code.
Get started with:
Add the following dependencies to the pom.xml file
Hibernate-c3p0: database connection pool
Jackson-core: used to manipulate json data
Spring-boot-starter-data-jpa will use Hibernate to manipulate the database.
Add database-related information to the application.properties file:
Please manually create the database spring_web in mysql and specify the utf-8 character set.
Spring.jackson.data-format: this property allows springmvc to automatically format the date into the corresponding format when it returns json data.
Access the database:
Create a new class under org.ramer.demo: repository.UserRepository:
Create a new class under test/java/org/ramer/demo: repository.TestUserRepository:
Saved successfully! Delete, update, and query will be left to you to test.
Therefore, you have completed the addition, deletion, modification and query of the database with a confused face. Spring-Data-Jpa is not only so powerful, but will continue to use its powerful functions in the future.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.