Hibernate (III) openSession and getCurrentSession

1, OID, HQL, SQL, QBC operations 1.1 ibernate has four operation modes, namely OID, HQL, QBC and SQL.   OID: object identifier. Hibernate is used to mark the unique object. In fact, it is the primary key Available operations: add, delete, modify and query For example, we often use save, update, delete, get, load, saveOrUpdate and other m ...

Posted on Sun, 29 Mar 2020 11:52:57 -0700 by buddhika2010

JPA object inheritance relationship

In the process of entity modeling, some entities will have many kinds of deformations, most of which are common, only a small part is unique. At this time, the more elegant design is to abstract the shared attributes to form a base class, and then the implementation class extends the unique attributes. Domain services can abstract common servic ...

Posted on Wed, 25 Mar 2020 05:18:10 -0700 by dancahill

[SSH] establishment of integrated development environment for SSH Framework

This paper summarizes the main steps of setting up the environment before using SSH framework. The environment built here is Struts2+Spring4+Hibernate5. The integration of the new version is also similar. First of all, I will review the general implementation of each layer involved in SSH Framework ...

Posted on Sat, 22 Feb 2020 04:13:26 -0800 by LostKID

Overview of Spring Data JPA

Overview of Spring Data JPA 1.1 overview of spring data JPA Spring Data JPA is a set of JPA application framework based on ORM framework and JPA specification. It enables developers to access and operate the database with simple code. It provides common functions including addition, deletion, modif ...

Posted on Wed, 19 Feb 2020 19:50:00 -0800 by itsmeArry

The use and principle of ThreadLocal

I. overview The simple understanding of ThreadLocal is to share resources for a thread, save some resources in the thread through set() method, and then obtain this resource through get method. It solves the problem of sharing the same object or variable in the same thread and method of different clas ...

Posted on Wed, 05 Feb 2020 23:24:57 -0800 by vhaxu

Hibernate multi table design

Multi table design In the development process, the requirement analysis is carried out in the early stage. The requirement analysis provides E-R diagram, and the table structure is compiled according to the ER diagram. There are three relationships between tables: one to many, many to many, and o ...

Posted on Tue, 04 Feb 2020 03:33:57 -0800 by dannyz

Design Mode - Agent Mode

In some cases, a client cannot or does not want to access another object directly, and then an intermediary is needed to help complete a task, which is a proxy object.For example, buying a train ticket does not necessarily mean going to a train station. It can be bought through the 12306 website or a ...

Posted on Mon, 03 Feb 2020 18:27:58 -0800 by Daijoubu

Hibernate (11) - one to many association mapping

This blog series is summarized here: Hibernate summary One to many association mapping One to many association mapping 1. Create model object 2. Configuration mapping file 3. Test one to many Preservation query 4. One to many two-way Association (1) Create model (2) Modify configuration (3) Test o ...

Posted on Wed, 29 Jan 2020 00:03:48 -0800 by nec9716

Hibernate (10) one-to-one association mapping

This blog series is summarized here: Hibernate summary One to one association mapping One to one association mapping 1. Create model class 2. Configuration mapping file 3. One to one single end test Preservation query 4. One to one bidirectional association mapping Preservation query The so ...

Posted on Tue, 28 Jan 2020 23:00:18 -0800 by zelot1980

Three states of objects in Hibernate_hibernate

This series of blogs is summarized here: Hibernate Summary Three states of objects 1. Three states of objects in hibernate 2. Transient Object to Persistent Object 3. Conversion of persistent and offline objects 4. Objects queried by get, load and iterator are persistent 5. Persistent and offline obje ...

Posted on Tue, 28 Jan 2020 19:32:28 -0800 by tmann