Hibernate -- learning (12) -- one to one association based on foreign key mapping
1. For the 1-1 association based on foreign key, the foreign key can be stored on either side, and the many to one element can be added at the end where the foreign key needs to be stored.
Add unique = "true" attribute to many to one element to represent 1-1 Association
2. The other end needs to use the one-to-one ...
Posted by zemerick on Wed, 04 Dec 2019 16:10:41 -0800
Introduction to IOC annotation development of Spring 1
The basic knowledge points are as follows:
Introduce annotation constraints and configure component scanning
Annotation on class: @ response @ Controller @Service @Repository
Annotation @ value of common attribute
Annotation @ Resource @ Autowired @ Qualifier for object properties
Bean life cycle, initialization and destruction: @ PostConstruc ...
Posted by sanand158 on Sun, 01 Dec 2019 20:13:59 -0800
Java springcloud B2B2C o2o multi user shopping mall springcloud architecture validation form information
This article mainly describes how to verify form information in springboot. In the spring MVC project, the form information needs to be checked, and the form information verification is mainly in the form of annotation.
Construction project
To create a springboot project, because web, thymeleaf, validator and el are used, corresponding start ...
Posted by shiva on Sun, 01 Dec 2019 20:00:07 -0800
Hibernate retrieval method (supplementary)
*
ps :
I. retrieval method of navigation object graph
Customer c=session.get(Customer.class,2);
c.getOrders().size();
Through mapping in Hibernate, the associated persistent object information can be obtained by navigation during hibernate operation.
II. OID search method
session.get(Customer.class,3);
session.load(Order.class,1);
In H ...
Posted by mjseaden on Fri, 29 Nov 2019 01:00:01 -0800
Extending hibernate 3.3 rc
Recently, druid monitoring is needed for maintenance of old projects, but druid is at least compatible with hibernate 4. There is no way to do this. You can do it by yourself.
Based on com.alibaba.druid.support.hibernate.DruidConnectionProvider, the ConnectionProvider interface is implemented
To use the druid data source, make the following c ...
Posted by tcollie on Tue, 26 Nov 2019 11:31:39 -0800
nginx shared memory mechanism explained in detail
Shared memory for nginx is one of the main reasons it can achieve high performance, mainly for file caching.This article first explains how shared memory is used, then how nginx manages shared memory.
1. Use examples
nginx declares that the instructions for shared memory are:
proxy_cache_path /Users/Mike/nginx-cache levels=1:2 keys_zone=one:10m ...
Posted by yaron on Mon, 25 Nov 2019 15:54:04 -0800
How to get the type of generic T, that is, T.class
How to get the type of generic T, that is, T.class
I want to write a mongodb tool class in spring boot, and simply encapsulate some of mongodb's entries. In the process of writing the tool class, I found that many of the mongodb methods integrated in spring boot need to use entity class types. In the tool class, I use generi ...
Posted by Jade on Sat, 23 Nov 2019 12:33:40 -0800
Know Your Own and Know Your Own: Persistent Evolution
Introduction
When it comes to the word "persistence", people who operate databases every day are certainly familiar with it.
In persistence, the two giants that have caught the attention of developers are Hibernate and MyBatis, and many developers often compare them.Google is a comparison of the two.
Hibernate and MyBatis, like java ...
Posted by ClanCC on Thu, 21 Nov 2019 12:14:01 -0800
web framework Spring+SpringMvc+Jpa pure annotation building
0.jar package depends on maven pom.xml
<properties>
<spring_version>4.3.25.RELEASE</spring_version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
...
Posted by zedan_80 on Wed, 20 Nov 2019 12:34:00 -0800
A problem with 250W views on Stack Overflow: your object is lost
When browsing Stack Overflow, I found that the most popular problem is: what is NullPointerException (java.lang.NullPointerException), what causes it, and whether there is a good way or tool to track the cause of it?
I didn't expect to see as many as 2.5 million views of this problem! So, I think it's time to sort out the best answers and share ...
Posted by maybl8r03 on Sun, 20 Oct 2019 19:43:41 -0700