Hibernate environment configuration mapping database SQL server, Mysql database, test correct
Recently, I have to digest a little more knowledge. I write notes in my blog for easy viewing
You can download the hibernate jar package you need on the official website
Configuring Sqlserver database in Hibernate
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernat ...
Added by PHPMagician on Thu, 02 Jan 2020 01:53:46 +0200
Hibernate Learning Notes 3 (HQL Query)
HQL statement
In Hibernate, although simple primary key query statements can be generated directly by Hibernate using the API, complex query statements need our own handwriting. Hibernate provides us with an HQL statement to use. HQL is the abbreviation of Hibernate Query Language, HQL is a statement close to SQL, b ...
Added by PHPTOM on Thu, 07 Nov 2019 21:20:33 +0200
Intelligent sales system
1. Project construction preparation
1. Build Maven web project
2. Import the jar package required by the project
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="h ...
Added by johnrcornell on Sat, 02 Nov 2019 17:06:09 +0200
hql statement query of Hibernate
HQL is the abbreviation of Hibernate Query Language, which provides more flexible and powerful query capabilities; HQL is closer to SQL query syntax.
query
Query all (persistent data)
// s: aliases must be aliased to objects, not *. Not in hibernate*
String hql="select s from Student s";
//The Que ...
Added by TNIDBMNG on Tue, 29 Oct 2019 18:29:11 +0200
[source code analysis] I don't know the details of automatic configuration, let alone you can spring boot.
Compared with spring, one of the most important characteristics of spring boot is automatic configuration, which makes the Convention larger than the configuration idea successfully implemented. XXX spring boot starter a series of bootstrappers can be used out of the box, or only need a few configurations (for beginners) because the default aut ...
Added by zemerick on Thu, 17 Oct 2019 04:55:14 +0300
Delete foreign key constraint fails
title: Delete foreign key constraint fails
date: 2018-08-02 21:59:06
tags: database
---
When I was learning hibernate at that time, I just learned one to many, many to many related operations. It happens that there is an item just in time, and the structure of the tables should be sorted out. As the saying goes, we need to use it when we learn ...
Added by aQ on Mon, 07 Oct 2019 08:46:18 +0300
Some methods of 16_EntityManager: find,getReference,persist,remove,merge
1.find method
First, override the toString method in the entity class
@Override
public String toString() {
return "Customer{" +
"id=" + id +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", age=" + age +
", createdTime=" ...
Added by echion on Sun, 06 Oct 2019 19:29:08 +0300
hibernate Association (one-to-many)
1. what is correlation (association)
1.1 Association refers to the reference relationship between classes. If class A is associated with class B, the referenced class B will be defined as the property of class A.
For example:
t_hibernate_order
t_hibernate_order_item
An order corresponds to multiple or ...
Added by !Mikey on Wed, 02 Oct 2019 15:06:49 +0300
Java Custom Annotation Verification Specified Fields Correspond to Database Content Repetition
I. Preface
In some scenarios, we need to verify whether the code is duplicated, whether the account number is duplicated, whether the ID number is duplicated, etc.
Codes like validation are as follows:
So is there any way to solve this similar amount of duplicate code?
We can achieve this by customizing annotation validation, as follows by add ...
Added by tidalwave on Mon, 23 Sep 2019 09:58:49 +0300
Deeply Understanding the Principles of go-channel and select
Two of the most attractive things about Go, besides goroutine, that is, channel, I've been wondering how select ion actually works. As in my previous article, some irrelevant code is omitted directly
1. Overview of structure
1.1. hchan
This is the structure of channel.
type hchan struct {
qcount uint // Total data in queues
da ...
Added by coco777 on Thu, 05 Sep 2019 05:06:15 +0300