SpringBoot 2.0 Basic Case (09): Integrating JPA persistence layer framework to simplify database operations
Introduction of JAP Framework
JPA(Java Persistence API), which means Java persistence API, is the Java persistence specification proposed by Sun after JDK 5.0. The main purpose is to simplify the development of persistence layer and integrate ORM technology, to end the situation of Hibernate, TopLink, JDO and other ORM frameworks operating inde ...
Posted by mortona on Thu, 15 Aug 2019 07:40:25 -0700
[Spring cloud realizes advertising system step by step] 5. Playing system configuration + boot + entity class
Main Class Description for Starting Advertising Playing System
/**
* SponsorApplication for Advertising Sponsor/Delivery Service Startup Class
* After adding the annotation {@link EnableFeignClients}, other microservices can be invoked by the current microservice.
* However, the current service is provided by advertisements, and no other mic ...
Posted by dave914 on Tue, 30 Jul 2019 20:29:49 -0700
SpringBoot - Data validation of forms
SpringBoot uses the Hibernate-validate checking framework
ValidateRules
@ NotBlank: Determines whether a string is null or empty (removing the first and last spaces).
@ NotEmpty: Determines whether a string is null or empty.
@ Length: Determine the length of a character (maximum or minimum)
@ M ...
Posted by shush on Tue, 30 Jul 2019 12:12:25 -0700
Spring method level data validation: @Validated + Method Validation PostProcessor
Every sentence
In Deep Work, the author puts forward a formula: high quality output = time * concentration. So high quality output does not depend on time, but on efficiency.
Relevant Reading
[Xiaojia Java] Deep understanding of data validation: Java Bean Validation 2.0 (JSR303, JSR349, JSR380) Hibernate-Validation 6.x use caseKnow more about B ...
Posted by fighnight on Fri, 26 Jul 2019 21:18:07 -0700
Deep understanding of data validation: Java Bean Validation 2.0 (JSR380)
We know that programs are usually hierarchical, and different layers are usually developed by different people. If you're an experienced programmer, I'm sure you've seen the same validation code in different layers, which is spam code in a sense. To solve this problem, Bean Validation defines the corresponding metadata model and API for JavaBea ...
Posted by skypilot on Tue, 23 Jul 2019 23:52:49 -0700
JVM tuning exploring physical memory return mechanism of CMS and G1
Preface:
The company has an asset statistics system, which is very low in usage, but requires fast query speed in use. Therefore, we want to make some caches stored in memory, not used for a long time, persistent to disk, and recycle garbage, return physical memory to the operating system, so as to save valuable resources to other businesses. S ...
Posted by timbr8ks on Mon, 22 Jul 2019 05:47:03 -0700
springboot+hibernate+mysql automatic table building
Introducing Maven dependency packages
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency&g ...
Posted by diggysmalls on Wed, 17 Jul 2019 13:00:57 -0700
hibernate Framework-Association Mapping (hibernate Mapping)
Set Mapping
Development process: requirements analysis/database design, project design/coding/testing/implementation deployment online/acceptance
Requirements: User purchase, fill in the address!
Database Design: Not available yet
Code
javabean designpublic class User {
private int userId;
private String userName;
// One us ...
Posted by TravisJRyan on Thu, 11 Jul 2019 09:32:51 -0700
Use of Hibernate annotations
In Hibernate, there are usually two ways to configure object-relational mapping, one is based on xml, the other is based on annotation of Hibernate Annotation library. In Hibernate version 3.2 and Java 5 environment, annotations are used to configure object-relational mapping. After using Hibernate annotations, the *.hbm.xml file corresponding ...
Posted by perrio on Sun, 07 Jul 2019 13:25:48 -0700
Object set preservation in hibernate
1. Objects are often used to operate in java web design, and object sets are saved in hibernate (one-to-many)
The following steps are required:
1) Designing data table relationships
2) Introducing jar packages requires attention to introducing database connector
3) Write entity classes
4) Configuration mapping file and hibernate.cfg.xml
Two c ...
Posted by minc on Fri, 05 Jul 2019 18:01:04 -0700