Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Database operation method based on Hibernate

An operation method and database technology, applied in the field of database management, can solve problems such as unfavorable focus on business logic processing, reduce code coupling, etc., and achieve the effects of improving development efficiency, reducing code coupling, and reducing the probability of problems.

Inactive Publication Date: 2015-12-09
INSPUR GROUP CO LTD
View PDF2 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Aiming at the problem that developers are not freed from basic database operations in the prior art, which is not conducive to focusing on the processing of business logic, the present invention provides a database operation method based on Hibernate generics, which is applied to Yunhai system to improve development efficiency. Reduce code coupling, so that developers are not freed from basic database operations, which is conducive to focusing on business logic processing

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0014] A Hibernate-based database operation method:

[0015] Encapsulate HibernateDAO: set the base class DAO interface of Hibernate, make it inherit the HibernateDaoSupport class, encapsulate the basic database operations, set the subclass DAO and inherit the base class DAO;

[0016] Configure the HQL statement: write the HQL statement in the Hibernate mapping file to form a key-value pair, use the primary key to find the corresponding HQL statement and execute it.

[0017] The specific process of HibernateDAO encapsulation is: setting the base class DAO interface of Hibernate, and specifying the basic functions of the base class DAO interface, defining the implementation of the base class DAO, and inheriting the HibernateDaoSupport class, setting the subclass DAO interface and implementing the base class interface, inheriting The base class DAO specifies the database operation object so that the base class can obtain the object type of the database operation.

[0018] Among...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a database operation method based on Hibernate, and belongs to the technical field of database management. Hibernate inheritance and polymorphism characteristics are sufficiently utilized for packaging base class DAO and enabling the base class DAO to inherit a Hibernate Dao Support class, the base class DAO can directly use the API of hibernate, and CRUD operation for different DAO objects is achieved. The phenomenon that a corresponding DAO interface is written for each database persistent object is not needed, duplicated code development is avoided, the problem occurrence probability is greatly reduced, the development efficiency is improved, code coupling is reduced, developers are not free of basic database operation, and focusing service logic processing is facilitated.

Description

technical field [0001] The invention discloses a database operation method, which belongs to the technical field of database management, and specifically relates to a Hibernate-based database operation method. Background technique [0002] With the development of cloud computing, more user requirements and business logic are brought, and the interaction of underlying data persistence becomes more frequent. As basic database operations, such as adding and deleting, changing, querying, etc., although there are many frameworks in the prior art that can provide API functions in an object-oriented manner and reduce the workload of developers, developers have not learned from basic database operations. Freed from having to implement basic CRUD functions for each object. In order to improve development efficiency, free developers from basic database operations, and focus more on business logic processing, this invention proposes a database operation method based on Hibernate gener...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30G06F9/44
CPCG06F16/21
Inventor 郭涛朱波刘正伟
Owner INSPUR GROUP CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products