There are often relationships between objects in life, such as one-to-one, one to many, many to many. For example, there are many students in a Course class who are one to many. In the database, you can add a foreign key to the Student table to point to the class id to indicate that the Student conta ...
Posted by monkuar on Thu, 27 Feb 2020 03:24:00 -0800
Why to learn HQL (hibernate query language) - > this is an official recommendation with powerful functions
Session.delete (object) - > batch delete
Modify - > batch modify
Query object obj
Query all ...
Posted by trilbyfish on Mon, 17 Feb 2020 00:38:56 -0800
When trying to convert a JPA object with two-way associations to JSON, I kept
org.codehaus.jackson.map.JsonMappingException: Infinite recursion (StackOverflowError)
All I found was The thread , basically ending with a recommendation to avoid two-way Association. Who knows the wrong solution this spring?
------Edited on July 24, 2010 16 ...
Posted by Xzone5 on Fri, 14 Feb 2020 06:14:15 -0800
1, Ask questions
When spring MVC encapsulates custom type objects, JavaBean s are bound to the data submitted by the page one by one. Here's what you need to know:
1) all data submitted by the page are strings
2) attributes in JavaBean s, such as Integer age;
When binding data, the following oper ...
Posted by saeed42 on Wed, 05 Feb 2020 22:31:22 -0800
1, Developing web applications
Spring Boot Web development is very simple, including common json output, filters, property, log, etc
2, json interface development
In the past, when using spring to develop projects, what needs to be done when you need to provide json interfaces?
1. Add related jar packages such as jackjson
2. Configure spri ...
Posted by Mikedean on Tue, 04 Feb 2020 23:11:06 -0800
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
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"
Posted by uglyrat on Sun, 12 Jan 2020 06:08:38 -0800
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
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
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