Let hql support bitwise and operation
Absrtact: at present, hibernate does not support bitwise and operation, and recent projects need such operation again. Fortunately, hibernate provides related extension functions and can realize relevant operation by itself
1, Background
In the work, MySQL is used as the database, java is used as the language of the p ...
Posted by goldages05 on Fri, 01 May 2020 13:39:48 -0700
Hibernate learning notes (6)
1, Object navigation query
Previous relationships between customers and contacts were one to many: One to many
Scenario: query the customer according to the customer id, and find out all contacts of the customer
@Test
public void selectTest(){
SessionFactory sessionFactory = null;
Session session = null;
Transacti ...
Posted by 01706 on Thu, 30 Apr 2020 11:07:51 -0700
springboot parameter check
SpringBoot has a built-in Hibernate Validator as the checking framework, so as long as we have integrated SpringBoot, we can use Hibernate Validator to complete parameter checking.
Common Notes
@Null: The commented property must be null;
@NotNull: The commented property cannot be null;
@AssertTrue: The commented property must be true;
@AssertF ...
Posted by soldbychris on Sat, 18 Apr 2020 21:09:36 -0700
spring boot jap+mybatis druid multi data source configuration
In fact, it is not difficult to configure spring boot jap+mybatis druid with multiple data sources
The key cannot be confused. Otherwise, after the configuration is completed, the connection of the druid data source may explode some strange errors, such as connection timeout, connection unavailable, etc
Reference resources:
Create a DataSour ...
Posted by marcusb on Sat, 04 Apr 2020 04:01:17 -0700
(transfer) the server opens a new Multithread to use HibernateSession to prevent No session
Original link of blogger: https://blog.csdn.net/zhengwei223/article/details/30506455
The new thread needs to bind the Hibernate session to use the functions of transaction and delay loading in the new thread, otherwise no session exception will be exposed;
terms of settlement:
//Business method
new Runnable() {
@Over ...
Posted by mourisj on Fri, 03 Apr 2020 10:28:25 -0700
Integration of spring boot 2. X development case Quartz task management system
CRUD task management system based on spring boot 2. X + quartz is suitable for small and medium-sized projects.
CRUD task management system based on spring boot + quartz:
https://gitee.com/52itstyle/spring-boot-quartz
development environment
JDK1.8,Maven,Eclipse
Technology stack
SpringBoot2.0.1,thymeleaf3.0.9,quartz2.3.0,iview,vue,layer,AdminL ...
Posted by deception54 on Fri, 03 Apr 2020 04:17:34 -0700
Introduction to Hibernate II (add, delete, modify and check)
Hibernate's addition, deletion, modification and query
increase
There are many ways to add, such as save, persist, savaoroupdate and merge.
The use method is as follows.
The code here follows the previous section
package test;
import java.util.Date;
import org.hibernate.Session;
import org.hibernate.SessionFactory ...
Posted by L0j1k on Thu, 02 Apr 2020 15:28:25 -0700
Seven notes of ssh integration combined with xml
1. In the previous pure xml mode, we have many configuration files. We can use annotation and xml to develop. In this way, our configuration files will be much less. At the same time, we can directly see the configuration in the class, so that we can quickly build a ssh integration project
First of all, we should consider: what do we need to re ...
Posted by FraXTC on Wed, 01 Apr 2020 16:31:22 -0700
Unit testing with JUnit in Intellij
These days, I'm groping for Intellij idea to record some small knowledge points.
First contact with Intellij and use Hibernate framework to operate mysql database. If you want to use unit test in Intellij, you know that Junit is needed, but it is not found by default.
How to solve it?
>>First, go to settings an ...
Posted by devx on Tue, 31 Mar 2020 05:54:40 -0700
Web development | hibernate - 06. Persistence class concept and operation of Hibernate
1. What is a persistence class
1. Persistence class: it is a Java class (the JavaBean we wrote), which can be a persistence class if the mapping relationship between the Java class and the table is established.
Persistence class = JavaBean + xxx.hbm.xml
2. The concept of persistent classes exists in the Hibernate framework e ...
Posted by just me and php on Sat, 28 Mar 2020 09:10:22 -0700