spring data jpa many to many relationship reports a missed entity passed to persist error
Recently, when spring data jpa is used to maintain many to many relationships between tables, a strange problem arises. When a new object is put into the entity class to maintain many to many relationship set, and then saved with jpa, the following exception will appear.
org.springframework.dao.InvalidDataAccessApiUsageException: detached enti ...
Posted by Shadow Wolf on Fri, 17 Jan 2020 00:58:31 -0800
springmvc+spring4.2+hibernate5 Integrated Records
1, Profile
There are a lot of jar packages involved. Here I choose to help me manage jars by maven
<?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="http://maven.apache. ...
Posted by uglyrat on Sun, 12 Jan 2020 06:08:38 -0800
Annotation analysis notes such as JPA one-to-one mapping@OneToOne
I've uploaded a two-way, one-to-one instance to GitHub, the entrance project, and downloaded and run if you're interested, here are two running problems.
Question 1: I left a question at the end of my last blog post.One-to-one Association query comment @OneToOne instance details
Problem point: At the en ...
Posted by dsjoes on Fri, 10 Jan 2020 18:19:32 -0800
Spring datajpa example condition paging query instance
The article refers to: https://blog.csdn.net/long476964/article/details/79677526 . This article introduces the use of the Example class.
Spring datajpa official document: https://docs.spring.io/spring-data/jpa/docs/2.0.9.RELEASE/reference/html/#query-by-example (English tycoon moves here)
spring data jpa Example condi ...
Posted by robertaccettura on Wed, 01 Jan 2020 03:45:28 -0800
Use of hibernate's @ EmbeddedId annotation
I. Preface
When we design tables for projects, sometimes we need to use composite primary keys to identify uniqueness. If the project's persistence layer adopts hibernate framework, we can use @ EmbeddedId annotation to achieve this requirement.
2, Table design
CREATE TABLE `mkt_mas_cpcus` (
`CR_ORG_NBR` decimal(3,0) NO ...
Posted by bass123 on Tue, 31 Dec 2019 22:30:03 -0800
Spring data integrates JPA (specifically implemented as (Hibernate));
Here, we take Maven as an example to send the map first, then the text information of Maven and configuration file (easy to copy and paste); the Oracle11g database jar package is in the lib directory of Oracle database installation, which is not specifically introduced here
Spring integrates Jpa configuration files: be careful, ...
Posted by manyamile on Thu, 26 Dec 2019 13:40:04 -0800
Learn from me about Spring Cloud AlibabaNacos service registration and discovery
Service registration and discovery, service discovery is mainly used to achieve automatic registration and discovery of individual micro-service instances. It is the core of micro-service governance. To learn Spring Cloud Alibaba, first of all, you need to understand the service registration and discovery component in the framework, Nacos.
1. S ...
Posted by Grimloch on Tue, 24 Dec 2019 17:55:27 -0800
Concurrency and Multithreading
Basic concepts
Concurrency and Parallelism
Concurrency: Two or more events occur at the same time interval.When multiple threads are operating, if the system has only one CPU, it is impossible for the system to actually run more than one thread at the same time. It can only divide the CPU run time into several time periods, then assign time pe ...
Posted by rekha on Sun, 22 Dec 2019 18:03:37 -0800
General paging of hibernate
First of all, look at a business requirement: fuzzy query data by book name and paging function. Usually, you can write the query method as follows, but it is troublesome if there are many query dimensions.
A new BaseDao is written to deal with this problem. The BaseDao code is as follows:
package com.zking.eight.util;
import j ...
Posted by kporter.porter on Mon, 09 Dec 2019 16:28:17 -0800
Quickly build ssh project
Environment: oracle11g, MyEclipse 2014
First, add the spring framework to the web project
Now that you've added the spring framework
Then we start to add the Hibernate Framework
At this point, the Hibernate framework is added
applicationContext.xml configuration file
<?xml version="1.0" encod ...
Posted by thallium6 on Wed, 04 Dec 2019 22:36:21 -0800