Automatic generation method of ORM DAO code based on database entity objects

By automatically identifying database entity objects and generating DAO instances within the ORM framework, the problems of repetitive code and tedious manual DAO file generation in the ORM framework are solved, thus simplifying database operation processes and improving development efficiency.

CN121029144BActive Publication Date: 2026-06-30英汇智能(深圳)有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
英汇智能(深圳)有限公司
Filing Date
2025-10-11
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In ORM frameworks, developers need to manually generate a large number of repetitive DAO and Mapper files, which leads to a large workload, a high risk of errors, high maintenance complexity, and poor flexibility and scalability.

Method used

During the application startup phase, the project code is traversed, database entity objects are identified and metadata is parsed, a general Mapper is configured, generic DAO class instances are generated, and they are registered through the IOC container to simplify the database operation process.

Benefits of technology

Improve development efficiency, reduce manual errors and maintenance costs, simplify database operation processes, and enhance code flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029144B_ABST
    Figure CN121029144B_ABST
Patent Text Reader

Abstract

This invention discloses an automatic ORM DAO code generation method based on database entity objects, belonging to the field of data processing technology. The method includes: traversing the project code during application startup to identify entity objects in the database and parse entity metadata based on preset annotations or class characteristics; configuring a generic Mapper to provide database operation methods shared by all tables; binding entity objects to generic DAO classes based on the generic Mapper to generate DAO instances corresponding to the entity objects; and registering the DAO instances to the IOC container as Bean definitions through the IOC container extension interface, enabling them to be instantiated and injected in subsequent lifecycles for database operations. This invention solves the technical problems of existing ORM frameworks having a large amount of repetitive code and the tedious manual generation of DAO and Mapper files, achieving the technical effects of improving development efficiency, reducing manual errors, and lowering maintenance costs.
Need to check novelty before this filing date? Find Prior Art