[SSH] SSH's hibernate framework: initial knowledge of Hibernate
What is Hibernate:
Hibernate is an open-source object relational mapping framework, which encapsulates JDBC with very lightweight objects. It establishes the mapping relationship between POJO and database tables. It is a fully automatic ORM framework. Hibernate can automatically generate SQL statement ...
Posted by myshoala on Thu, 06 Feb 2020 08:28:54 +0100
Hibernate (17) grab strategy
This blog series is summarized here: Hibernate summary
Fetching strategies
Fetching strategies
1. Multi to one single end grabbing
The first way
The second way
2. One to many grabs
One end of one is a single object query
One end is multiple object queries
Source project file: Hibernate 4.3_ ...
Posted by billman on Wed, 29 Jan 2020 15:09:04 +0100
SSH integration: Spring 5.2.2 + struts 2.5.22 + Hibernate 5.8
SSH integration: Spring 5.2.2 + struts 2.5.22 + Hibernate 5.8
1, Environment construction
Database: MySQL 8JDK: 13
jar package
Spring
Struts
Hibernate
Spring integrates Hibernate
Struts integrates Spring
-C3p0
Connect to database
Using Hibernate above JDK8 requires importing
2, ...
Posted by landonmkelsey on Sun, 12 Jan 2020 15:46:14 +0100
What you should know about the singleton pattern
Singleton mode
Usage scenario:
Hibernate only needs one SessionFactory
In Spring, if scope="singleton" is specified, the bean will be singleton (default singleton is not specified). Business logic component, DAO component and data source component are singleton, because they do not need to save the user's state
The ...
Posted by Torleif on Tue, 03 Dec 2019 03:38:29 +0100
QBC query of Hibernate
Customer.java
public class Customer {
public Customer() {
super();
// TODO Auto-generated constructor stub
}
public Customer(String cust_name, String cust_source) {
super();
this.cust_name = cust_name;
this.cust_source = cust_source;
}
private Long cust_id;
private String cust_name;
private String cust_so ...
Posted by Nat on Mon, 02 Dec 2019 14:56:22 +0100
Many to one one one-way association mapping of hibernate in java
1. I learned crud operation of single table before. In practical applications, most of them are multi table Association operations. This article will learn how to deal with the relationship between multi tables.
2. Investigate the relationship between book list and book classification table. There is a many to one relationship between the book ...
Posted by nuying117 on Wed, 23 Oct 2019 18:03:28 +0200
Java multithreading - thread abortion
Incorrect thread abort - Stop
Stop: Discontinues threads and clears information about monitor locks, but may causeJDK is not recommended for thread security issues.Destroy: JDK does not implement this method.
/**
* @author simon
*/
public class StopThread extends Thread {
private int i = 0, j = 0;
@Override
public void run() {
...
Posted by The_broken on Sun, 06 Oct 2019 04:15:50 +0200
jdbcTemplate executes sql to get the collection of objects
In a project, you may encounter that the project architecture is hibernate, but some queries are still used to sql statements, or some queries are more simple and flexible with sql statements. At this point we can inject jdbcTemplate.
1. Configuration and injection of jdbctemplate in non-spring boot projectsConfiguration: Register beans in spri ...
Posted by jonoc33 on Sat, 05 Oct 2019 19:22:01 +0200
Detailed steps for building SSH framework in IntelliJ IDEA
Don't say much, just get to the point!
1. Click File to create a new Module
2. Click and select Spring, then check Spring on the right (when checking Spring, we will prompt you to create spring-config.xml, here we check it for convenience), Web Application, St ...
Posted by JVassie on Tue, 01 Oct 2019 05:54:58 +0200
Introduction and Use of Hibernate Validator
Preface
Recently, when developing the function of a module, it contains a lot of steps of blanking and validating the request parameters, and there are a lot of repeated judgments. Validation affects the beauty of the code and then decides to optimize this part of the code. SpringBoot comes with its own parameter validation box, Hibernate Valid ...
Posted by zak on Tue, 01 Oct 2019 05:12:34 +0200