Insurance management system based on rapid development of persistence layer code auxiliary method
By automating the generation and integration of persistent layer code containing business logic validation, the problem of lack of business rules and inconsistent integration and deployment during the generation of persistent layer code in the insurance management system was solved, achieving rapid and reliable component delivery and enhanced security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN YUANFU INFORMATION TECH CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-07-03
AI Technical Summary
The existing insurance management system lacks business rule validation during the persistent layer code generation process, which increases the development burden and makes it easy for validation logic to be omitted or inconsistent. Furthermore, the code integration and deployment process is cumbersome and difficult to maintain consistency, making it impossible to achieve fast and reliable component delivery.
The insurance management system adopts a rapid development method for persistent layer code assistance, including a model processing module, a code generation module, a mapping and enhancement module, and an integration and deployment module. It automatically generates persistent layer code containing business logic verification and completes integration and deployment through automated build scripts.
It enables the persistence layer code to natively execute business rules, reducing the risk of developers performing repeated verifications, improving code robustness and business security, and ensuring standard consistency and repeatability of the integration process through automated processes, thus shortening the development iteration cycle.
Smart Images

Figure CN122331891A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of insurance software code generation technology, and in particular to an insurance management system based on a rapid development method for persistent layer code. Background Technology
[0002] In the development of insurance management systems, writing persistent layer code is a tedious and repetitive task. Existing technologies typically utilize general-purpose code generation tools or object-relational mapping frameworks to automatically generate entity classes and basic data access code based on the database table structure. This approach replaces some manual coding, improving the efficiency of infrastructure construction.
[0003] The existing technical solution has shortcomings. The generated code only implements a simple mapping between data tables and object attributes, forming a completely neutral data access layer that does not include any insurance-specific business rules. Any business logic validation related to data validity and state transitions must be manually analyzed and added by developers in the generated code. This process not only increases the development burden but also easily leads to omissions or inconsistencies in validation logic, leaving the data layer without mandatory protection for core business rules.
[0004] The integration and deployment phases after code generation still heavily rely on manual processes. Developers must manually organize the generated, scattered code files into the project directory and correctly configure the dependencies of the build tools before they can be used by the main system. This process is tedious, error-prone, and lacks consistency across different development environments, hindering rapid and reliable delivery from code generation to a runnable component. Therefore, a persistent layer code generation solution is needed that can directly generate code with built-in business validation and automate deployment and integration. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing an insurance management system based on a rapid development method for persistent layer code.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: an insurance management system based on a rapid development method for persistent layer code, comprising: The model processing module receives the insurance business data model definition submitted by the user, performs syntax and semantic verification on the insurance business data model definition, and generates standardized data model description information. The code generation module automatically generates entity class code, data access object interface code, and basic CRUD operation method code corresponding to the database table structure, based on a predefined code template library and standardized data model description information. The mapping and enhancement module parses the signature of the data access object interface code, automatically generates the corresponding structured query language mapping configuration file, maps and associates entity class attributes with database table fields, automatically identifies key business fields in the insurance business data model during the code generation process, and automatically injects business logic verification code fragments into database operations containing the key business fields. The integration and deployment module organizes the automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file according to the preset project structure, and encapsulates them into a persistent layer code package that can be deployed independently. The encapsulated persistent layer code package is then published to the target development environment, and an automated build script is executed to integrate the persistent layer components into the insurance management system under development.
[0007] As a further aspect of the present invention, the step of receiving the insurance business data model definition submitted by the user, and performing syntax and semantic verification on the insurance business data model definition to generate standardized data model description information specifically includes: The system receives insurance business data model definitions input by users through a graphical interface or a domain-specific language. The insurance business data model definitions include entity class names, attribute lists, attribute data types, primary key identifiers, and table relationship definitions. Based on a predefined insurance domain meta-model, the entity class names and attribute names in the definition of the insurance business data model are checked for legality to ensure that they comply with programming language naming conventions and insurance industry terminology standards. Verify the correctness of the table relationship definitions in the insurance business data model definition, including whether the definitions of one-to-one, one-to-many, and many-to-many relationships are complete and consistent, and whether foreign key attributes exist and match their types. The validated insurance business data model definition is structurally transformed to extract entity, attribute, relationship, and constraint information, generating standardized data model description information containing complete metadata. The standardized data model description information is described in a specific format.
[0008] As a further aspect of the present invention, the automatic generation of entity class code, data access object interface code, and basic CRUD operation method code corresponding to the database table structure based on a predefined code template library and standardized data model description information specifically includes: Read entity class code templates from the code template library, fill the entity class name, attribute list and attribute data type from the standardized data model description information into the corresponding placeholders in the entity class code template, and generate entity class code containing complete attribute definitions, get methods and set methods; Read the data access object interface code template from the code template library, fill the entity class name and primary key data type from the standardized data model description information into the corresponding placeholders in the data access object interface code template, and generate data access object interface code that declares the methods for adding, deleting, modifying, querying, conditional querying, and pagination querying for entity classes; The code templates for basic operation methods are read from the code template library. The entity class name, attribute name, and primary key name in the standardized data model description information are filled into the corresponding placeholders in the basic operation method code templates to generate persistent logic code that implements the methods such as add, delete, modify, query, conditional query, and pagination query declared in the data access object interface.
[0009] As a further aspect of the present invention, the signature of the data access object interface code is parsed to automatically generate a corresponding structured query language mapping configuration file, and entity class attributes are mapped and associated with database table fields, specifically as follows: Parse all method signatures declared in the generated data access object interface code, and identify the method name, parameter type, return type, and custom query statements declared through annotations; Based on the database table names, field names, primary key names, and field data types defined in the standardized data model description information, a core configuration file describing the mapping relationship between entity classes and database tables is generated. For custom query statements declared through annotations, extract their query logic and convert them into structured query language statements that the database management system can recognize, and configure them in a separate query mapping file; For conditional query and pagination query methods declared in the data access object interface code, the query conditions are automatically derived according to the naming convention of the method name, and a dynamic structured query language fragment configuration is generated. All generated mapping and query configurations are integrated according to preset rules to output a complete Structured Query Language mapping configuration file corresponding to the Data Access Object Interface.
[0010] As a further aspect of the present invention, the step of automatically identifying key business fields in the insurance business data model during code generation and automatically injecting business logic validation code fragments into database operations containing the key business fields specifically involves: When parsing the standardized data model description information, the key business fields in the insurance business data model are identified by matching attribute names or attribute annotations according to the predefined key business field feature library. The key business fields include policy number, insured's ID number, and insurance amount field. When generating method code to perform add or update operations on entity classes containing key business fields, a validation code snippet for verifying the integrity of key business field data and compliance with business rules is automatically inserted inside the method body before the persistence operation is executed. When generating method code to perform query operations on entity classes containing key business fields, post-processing code snippets for data desensitization or formatting of key business fields in the query results are automatically inserted before the query results are returned. The automatically injected validation code snippets and post-processing code snippets are derived from the business rule code snippet library associated with the code template library, and the injection location is determined by the predefined anchor points in the code template.
[0011] As a further aspect of the present invention, the automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file are organized according to a preset project structure and encapsulated into a persistent layer code package that can be deployed independently. Specifically: Based on the preset multi-level project directory structure, the generated entity class code files are placed in the entity class directory, the generated data access object interface code files are placed in the data access object interface directory, the generated basic CRUD operation method code files are placed in the data access object implementation class directory, and the generated structured query language mapping configuration files are placed in the resource mapping file directory. Check whether the reference relationships between code files and configuration files in each directory are correct, including the inheritance and implementation relationships between classes and the reference paths of configuration files; Based on the project dependency management file, generate a dependency description file containing necessary third-party dependency declarations for the persistence layer code package; The well-organized directory structure, code files, configuration files, and dependency description files are compressed and packaged using a packaging tool to generate a persistent layer code package that can be deployed independently.
[0012] As a further aspect of the present invention, the step of publishing the encapsulated persistence layer code package to the target development environment and executing an automated build script to integrate the persistence layer component into the insurance management system under development specifically involves: Submit the persistent layer code package to the target development environment's code repository using a version control tool, or upload it to the specified server path of the target development environment via a file transfer protocol; In the target development environment, an automated build script is invoked. The automated build script contains instructions for decompressing the persistence layer code package, parsing the dependency description file, downloading third-party dependency libraries, compiling the source code, running unit tests, and packaging to generate an executable component. Execute automated build scripts to compile, test, and build the persistence layer code package, generating persistence layer component library files that meet the requirements of the target development environment; Deploy the successfully built persistent layer component library file to the project dependency path of the insurance management system, and update the project configuration file of the insurance management system to reference the newly integrated persistent layer component; Start the insurance management system to verify whether the persistent layer components can be successfully loaded, and whether the connection to the database and basic operation functions are normal.
[0013] As a further aspect of the present invention, based on the database table names, field names, primary key names, and field data types defined in the standardized data model description information, a core configuration file describing the mapping relationship between entity classes and database tables is generated, specifically as follows: Read the standardized data model description information and extract the entity class names and corresponding database table names defined therein; Extract each attribute name of the entity class and its corresponding database table field name, field data type, whether it is a primary key, and whether it is a nullable field; Based on the extracted information, and following the format specifications of the Structured Query Language mapping configuration file, configuration statements that map entity class attributes to database table fields are generated line by line. For primary key attributes, additional configuration statements for primary key generation strategies are generated. These configuration statements include auto-increment, sequence, and program-specified strategies. The generated entity class and table mapping configuration statements, attribute and field mapping configuration statements, and primary key strategy configuration statements are combined to form a complete core configuration paragraph that describes the mapping relationship between a single entity class and a database table.
[0014] As a further aspect of the present invention, when generating method code for adding or updating entity classes containing key business fields, a verification code snippet for validating the integrity of key business field data and compliance with business rules is automatically inserted within the method body before the persistence operation is executed. Specifically: During the code generation phase, when traversing the code template for adding or updating methods of entity classes containing key business fields, the preset code injection anchor point in the template before executing the persistence operation statement is located. Based on the list of key business fields identified in the standardized data model description information, data integrity verification rules and business compliance verification rules corresponding to each key business field are retrieved from the business rule code fragment library; The retrieved validation rules are converted into specific conditional statements and exception throwing code statements to form validation code snippets; The generated validation code snippets are inserted into the preset code injection anchor points of the code template according to the validation order of the key business fields in the business logic. Generate the final method code, which includes validation logic for each key business field that is executed sequentially before the persistence operation.
[0015] As a further aspect of the present invention, the step of generating a dependency description file containing necessary third-party dependency declarations for the persistent layer code package based on the project dependency management file specifically includes: Read the project's preset dependency management file, which defines the coordinates and version ranges of the basic framework dependencies, database driver dependencies, and connection pool dependencies required by the insurance management system's persistence layer; Analyze the application programming interfaces and third-party libraries directly used in the automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file; The analyzed third-party library dependencies that are directly used are merged with the basic dependencies of the persistence layer defined in the dependency management file, and duplicates are removed to form a complete list of dependencies for the persistence layer code package. Based on the format required by the build tools used in the target development environment, each dependency in the complete persistent layer code package dependency list is converted into a corresponding dependency declaration statement; Write all dependency declarations into a new file to generate the dependency description file for the persistence layer code package.
[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: During the code generation phase, the system automatically identifies predefined or naming-compliant key business fields in the insurance business model by parsing standardized data model description information. For data operation methods involving these key fields, the system automatically embeds logic validation code snippets corresponding to the business meaning of the fields within the generated method bodies. This enables the generated persistent layer code to natively execute business rules, sinking key validation logic from the application layer and solidifying it at the data access layer. Developers no longer need to repeatedly write the same data validity validation in their business code, implementing unified business constraints from the source of data access, reducing the risk of data errors due to validation omissions or conflicts, and improving code robustness and business security.
[0017] After creating the code and mapping files, the system automatically organizes, packages, and manages the versions of all generated artifacts according to a predefined project structure template, forming an independent component package that can be directly compiled and used as a dependency. This component package is automatically published to the artifact repository of the target development environment, and the associated automated build script is executed to complete component installation and update project dependency configurations. This eliminates a series of manual steps such as integrating code files, modifying build description files, and managing dependency versions. The generated persistent layer components can be seamlessly referenced and built by the main project, realizing a complete automated process from model definition to component integration readiness, ensuring standard consistency and repeatability of the integration process, and shortening the development iteration cycle. Attached Figure Description
[0018] Figure 1 This is a sequence diagram of the insurance management system based on the rapid development method for persistent layer code as described in this invention; Figure 2 A flowchart for generating code for entity classes and data access objects; Figure 3 A flowchart generated for mapping configuration files to Structured Query Language; Figure 4 Efficiency analysis chart for generating persistent layer code; Figure 5 A graph illustrating the efficiency and quality analysis of the data model processing stage in insurance business. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0020] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0021] See Figure 1The model processing module receives the insurance business data model definition submitted by the user and performs syntactic and semantic checks on the definition to generate a standardized data model description. The code generation module, based on a predefined code template library and the aforementioned standardized data model description, automatically generates entity class code, data access object interface code, and basic CRUD operation method code corresponding to the database table structure. The mapping and enhancement module then intervenes, parsing the method signatures of the generated data access object interface code and automatically generating the corresponding Structured Query Language (SCL) mapping configuration file to achieve the mapping association between entity class attributes and database table fields. Simultaneously, during code generation, this module automatically identifies key business fields defined within the insurance business data model and automatically injects pre-defined business logic validation code snippets into database operation methods involving these key business fields. The integration and deployment module organizes all the automatically generated code files and configuration files according to a pre-defined project directory structure and encapsulates them into a deployable persistence layer code package. This module publishes this code package to the target development environment and executes automated build scripts to complete compilation, testing, and integration, ultimately merging the persistence layer component into the insurance management system under development.
[0022] See Figure 2 In one embodiment of the present invention, the model processing module receives an insurance business data model definition input by a user through a graphical interface or a domain-specific language. An example of an insurance business data model definition is as follows: an entity named "InsurancePolicy" is defined, whose attribute list includes "policyNumber" (string type, marked as the primary key), "insuredID" (string type), "premium" (floating-point number type), and "effectiveDate" (date type), and a one-to-many relationship is defined with the entity "Claim". In a specific implementation, the model processing module, based on a predefined insurance domain meta-model, performs a validity check on the entity class name "InsurancePolicy" and attribute names such as "policyNumber" and "insuredID" in the insurance business data model definition. The check ensures that the names conform to Java language naming conventions and that the "insuredID" attribute name conforms to industry-standard terminology for identifying insured persons. In practice, the model processing module verifies the correctness of the one-to-many relationship definition between the "InsurancePolicy" entity and the "Claim" entity in the insurance business data model definition. The verification process confirms that the relationship definition is complete, the foreign key attribute exists, and the type of the foreign key attribute matches the primary key type of the referenced entity.
[0023] In some embodiments, the model processing module performs a structured transformation on the validated insurance business data model definition, extracting entity, attribute, relationship, and constraint information. The generated standardized data model description information is described in JSON format. The standardized data model description information includes complete metadata, such as entity name, corresponding database table name, name of each attribute, database field name, field data type, whether it is a primary key, whether null values are allowed, and the relationship type with other entities. In a specific implementation, the code generation module reads entity class code templates from a code template library. The entity class code template is a Java class file framework containing class name placeholders, attribute list placeholders, and data type placeholders. The code generation module fills the class name "InsurancePolicy" from the standardized data model description information into the class name placeholder, and fills the attribute list "policyNumber", "insuredID", "premium", "effectiveDate" and their corresponding data types "String", "String", "Double", and "Date" into the attribute list placeholder, generating complete entity class Java source code containing private declarations of these attributes and corresponding public getter and setter methods.
[0024] In some embodiments, the code generation module reads a data access object interface code template from a code template library. This template is a Java interface template that declares the signatures of methods for adding, deleting, modifying, querying, conditional queries, and paginated queries. The code generation module fills the entity class name "InsurancePolicy" and the primary key data type "String" from the standardized data model description information into the corresponding placeholders in the data access object interface code template, generating an interface named "InsurancePolicyDao". This interface declares specific methods such as "save(InsurancePolicyentity)", "deleteById(Stringid)", "update(InsurancePolicyentity)", and "findById(Stringid)". In a more specific implementation, the code generation module reads a basic operation method code template from the code template library. This template contains the method body framework for implementing persistence logic such as adding, deleting, modifying, and querying. The code generation module fills the entity class name "InsurancePolicy" and the primary key name "policyNumber" from the standardized data model description information into the corresponding placeholders in the basic operation method code template, generating Java class code that implements the specific logic of all declared methods in the "InsurancePolicyDao" interface. The logic includes statements that use the persistence framework application interface to perform database operations.
[0025] See Figure 3 In one embodiment of the present invention, the mapping and enhancement module parses all declared method signatures in the generated data access object interface code, identifies the method name, parameter type, return type, and custom query statements declared through annotations. Based on the database table name, field name, primary key name, and field data type defined in the standardized data model description information, the mapping and enhancement module generates a core configuration file describing the mapping relationship between entity classes and database tables. When generating the core configuration file, the mapping and enhancement module reads the standardized data model description information, extracts the entity class name and its corresponding database table name, and extracts each attribute name of the entity class and its corresponding database table field name, field data type, whether it is a primary key, and whether it is a nullable field. Based on the extracted information, and following the format specifications of the Structured Query Language mapping configuration file, the module generates configuration statements line by line that map entity class attributes to database table fields. For primary key attributes, the mapping and enhancement module additionally generates configuration statements for primary key generation strategies. These configuration statements include auto-increment, sequence, and program-specified strategies. The mapping and enhancement module combines the generated entity class and table mapping configuration statements, attribute and field mapping configuration statements, and primary key strategy configuration statements to form a complete core configuration paragraph that describes the mapping relationship between a single entity class and a database table.
[0026] In some embodiments, for custom query statements declared via annotations, the mapping and enhancement module extracts their query logic and converts it into a Structured Query Language (SCL) statement recognizable by the database management system, configuring it in a separate query mapping file. Optionally, for conditional queries and pagination query methods declared in the data access object interface code, the mapping and enhancement module automatically derives query conditions based on their method name naming conventions and generates dynamic SCL fragment configurations. The mapping and enhancement module integrates all generated mapping configurations and query configurations according to preset rules, outputting a complete SCL mapping configuration file corresponding to the data access object interface. In specific implementations, the generation process of the mapping configuration involves precise mapping from attributes to database fields, and the generation of each attribute mapping configuration statement follows mapping rules: in: This is a configuration tuple representing the mapping from attribute i to field j. This represents the name of the i-th attribute. This represents the name of the j-th database field. This indicates the k-th data type. The mapping and enhancement module generates mapping configuration statements for all attributes based on this rule.
[0027] In some embodiments, the mapping and enhancement module processes the entity "InsurancePolicy" defined in the standardized data model description information. This entity corresponds to the database table "ins_policy," where the attribute "policyNumber" maps to the field "policy_number" with a string data type, and the attribute "premium" maps to the field "premium_amount" with a floating-point data type. The core configuration paragraph generated by the mapping and enhancement module contains entity class and table mapping configuration statements.<classname="InsurancePolicy"table="ins_policy"> "Attribute mapping configuration statement"<propertyname="policyNumber"column="policy_number"type="string" / > "and primary key strategy configuration statements"<idname="policyNumber"column="policy_number"><generatorclass="assigned" / > Optionally, for the conditional query method "findByPolicyNumberAndStatus(StringpolicyNumber,Stringstatus)" declared in the data access object interface code, the mapping and enhancement module parses the query condition "WHEREpolicy_number=:policyNumberANDstatus=:status" based on the method name and generates a dynamic structured query language fragment configuration. It can be understood that the mapping and enhancement module, through automated parsing and configuration generation, achieves the conversion from code signing to a structured query language mapping configuration file. In specific implementation, the structured query language mapping configuration file output by the mapping and enhancement module after integrating all configurations is stored in XML format. The file contains complete entity mappings, custom query statement mappings, and dynamic query fragment mappings.
[0028] In one embodiment of the present invention, when the mapping and enhancement module parses the standardized data model description information during code generation, it matches attribute names or attribute annotations according to a predefined key business field feature library to identify key business fields in the insurance business data model. These key business fields include the policy number, the insured's ID number, and the insurance amount. In a specific implementation, when generating method code for adding or updating entity classes containing key business fields, the mapping and enhancement module automatically inserts a verification code snippet within the method body before executing the persistence operation to check the integrity of the key business field data and its compliance with business rules. During the code generation phase, when traversing the add or update method code template for entity classes containing key business fields, the mapping and enhancement module locates the preset code injection anchor point in the template before the persistence operation statement.
[0029] In some embodiments, the mapping and enhancement module identifies a list of key business fields from the standardized data model description information. It then retrieves data integrity verification rules and business compliance verification rules corresponding to each key business field from a business rule code snippet library. The module converts these verification rules into specific conditional statements and exception throwing code statements to form verification code snippets. These snippets are then inserted into preset code injection anchor points in the code template according to the verification order of the key business fields in the business logic. Finally, the module generates the final method code, which includes the verification logic for each key business field executed sequentially before the persistence operation. In practical implementation, for the "InsurancePolicy" entity in the insurance business data model, the mapping and enhancement module identifies "policyNumber" (policy number), "insuredID" (insured's ID number), and "premium" (insurance amount) as key business fields. The mapping and enhancement module retrieves the verification rules for "insuredID" from the business rule code fragment library, which is to check whether its length is 18 digits and conforms to the check code rules, and the verification rules for "premium" are to check whether its value is greater than zero.
[0030] Optionally, the mapping and enhancement modules may follow a business rule priority function when generating validation logic: in: Represents the set of key business fields The comprehensive verification priority sequence, Indicates the number of key business fields. Indicates the first Key business fields The business rule weighting coefficient Indicates the field The verification rule function outputs 0 or 1 to indicate whether verification is triggered. The mapping and enhancement module arranges the injection order of the verification code snippets according to the output order of this function. In the generated "save" method code, before executing the database insert statement, the mapping and enhancement module sequentially inserts code snippets to verify the "insuredID" format and code snippets to verify that "premium" is greater than zero.
[0031] In some embodiments, when the mapping and enhancement module generates method code for querying entity classes containing key business fields, it automatically inserts post-processing code snippets for data anonymization or formatting of the key business fields in the query results before returning the query results. It is understood that the automatically injected validation and post-processing code snippets originate from a business rule code snippet library associated with the code template library, and the injection location is determined by predefined anchor points in the code template. Optionally, for the "findById" query method, the post-processing code snippet injected by the mapping and enhancement module anonymizes the "insuredID" field in the query results from "110101199001011234" to "110101********1234". It is understood that through a preset anchor point mechanism and rule library retrieval, business logic validation and post-processing code are automatically integrated into the persistence layer operation code.
[0032] In one embodiment of the present invention, the integrated deployment module organizes the generated code and configuration files according to a preset multi-level project directory structure. In a specific implementation, the generated entity class code file "InsurancePolicy.java" is placed in the "src / main / java / com / example / entity" directory, the generated data access object interface code file "InsurancePolicyDao.java" is placed in the "src / main / java / com / example / dao" directory, the generated basic CRUD operation method code file "InsurancePolicyDaoImpl.java" is placed in the "src / main / java / com / example / dao / impl" directory, and the generated structured query language mapping configuration file "InsurancePolicy.hbm.xml" is placed in the "src / main / resources / mapping" directory. The integration and deployment module checks whether the reference relationships between code files and configuration files in each directory are correct. The checks include whether the "InsurancePolicyDaoImpl" class correctly implements the "InsurancePolicyDao" interface, whether the "InsurancePolicyDaoImpl" class correctly imports the "InsurancePolicy" entity class, and whether the mapping configuration file is correctly configured in the project classpath.
[0033] In some embodiments, the integration deployment module generates a dependency description file containing necessary third-party dependency declarations for the persistence layer code package based on the project dependency management file. When generating the dependency description file, the integration deployment module reads the project's preset dependency management file, which defines the coordinates and version ranges of the basic framework dependencies, database driver dependencies, and connection pool dependencies required by the insurance management system's persistence layer. The integration deployment module analyzes the automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file. The analysis process identifies the application interfaces and annotations directly used in the code, including, for example, annotations from the "javax.persistence" package and classes from the "org.hibernate" package. The integration deployment module merges the analyzed directly used third-party library dependencies with the persistence layer's basic dependencies defined in the dependency management file. The merging process removes duplicates and forms a complete dependency list for the persistence layer code package. The logic of dependency merging can be expressed as the formula: in: Represents the final complete set of dependencies. This represents the set of basic dependencies parsed from the project dependency management file. This refers to the set of dependencies that can be directly used, analyzed from the generated code and configuration files. This indicates that the union result is deduplicated. The integration and deployment module converts each dependency in the complete dependency list of the persistent layer code package into a corresponding dependency declaration statement according to the format required by the build tools used by the target development environment. All dependency declaration statements are written to a new file to generate the dependency description file "pom.xml" or "build.gradle" of the persistent layer code package. See Table 1 for an example of dependency merging analysis.
[0034] Table 1: Dependency Merging Analysis Table Optionally, the integration and deployment module uses a packaging tool to compress and encapsulate the organized complete directory structure, all code files, configuration files, and dependency description files, generating a standalone deployable persistence layer code package, "persistence-layer.jar". It can be understood that through the above organization and encapsulation operations, all generated code and configuration resources are integrated into a clearly structured, dependency-defined deployable unit. In some embodiments, the integration and deployment module resolves transitive relationships between dependencies when generating the dependency description file, and explicitly declares the versions of all necessary direct and transitive dependencies in the final dependency description file. It can be understood that the generated dependency description file ensures that the persistence layer code package can resolve all necessary library files when the target environment is built.
[0035] See Figure 4 This is a chart analyzing the efficiency of persistent layer code generation in an insurance management system. It compares the time consumption of persistent layer code generation at different stages. For single-table generation, the time consumption at each stage is between 8-16 seconds, with relatively small overall fluctuations. For batch generation of 10 tables, the time consumption is significantly higher at each stage, fluctuating between 45-89 seconds, peaking at the "mapping file generation" stage. This stage is the most time-consuming for both single-table and batch generation, indicating that configuring the mapping between entity classes and database tables is the most time-consuming step. Batch generation takes much longer than single-table generation, reflecting the scale effect of batch operations. The time consumption of batch generation is not simply "single-table time × 10," but rather there is significant efficiency loss at certain stages. Single-table generation is generally more efficient and suitable for rapid iterative development; batch generation is more suitable for building a complete persistent layer structure at once.
[0036] In one embodiment of the present invention, the integration and deployment module submits the packaged persistence layer code package to the code repository of the target development environment through a version control tool. In a specific implementation, the integration and deployment module submits the persistence layer code package named "policy-persistence-1.0.0.jar" to the "feature / persistence-layer" branch of the company's GitLab code repository using a Git tool. Optionally, the integration and deployment module can also upload the persistence layer code package to a specified server path of the target development environment via a file transfer protocol, for example, by uploading the "policy-persistence-1.0.0.jar" file to the " / opt / deploy / packages / " directory via the FTP protocol.
[0037] In some embodiments, within the target development environment, the integration deployment module invokes an automated build script. This automated build script includes instructions for decompressing the persistence layer code package, parsing dependency description files, downloading third-party dependency libraries, compiling source code, running unit tests, and packaging to generate an executable component. The integration deployment module executes the automated build script to compile, test, and build the persistence layer code package, generating a persistence layer component library file that meets the requirements of the target development environment. The build process involves calculating the build success rate. in: Indicates the success rate of the build. This indicates the number of times key instructions in the build script (including compilation, testing, and packaging) have been successfully executed. This indicates the total number of times key instructions in the build script have been executed. The integration and deployment module uses this metric to monitor the stability of the build process. The integration and deployment module deploys the successfully built persistent layer component library files to the project dependency path of the insurance management system. For example, it copies the generated "policy-persistence-1.0.0-SNAPSHOT.jar" file to the "lib / " directory of the insurance management system project.
[0038] In practical implementation, the integration and deployment module updates the insurance management system's project configuration file to reference the newly integrated persistent layer component. This update involves modifying the insurance management system project's build configuration file, adding a reference to the newly generated persistent layer component library file in the dependency declaration section. Essentially, the integration and deployment module starts the insurance management system, verifies whether the persistent layer component can be successfully loaded, and whether the connection to the database and basic operational functions are normal. This verification process includes checking the system startup log for a message indicating successful initialization of the persistent layer component and performing a simple database query to confirm normal connection and functionality. In some embodiments, the specific instruction sequence of the automated build script varies depending on the build tool used by the target development environment. For example, when using Maven, the automated build script includes the instruction sequence "mvncleancompile", "mvntest", and "mvnpackage". Optionally, when downloading third-party dependency libraries during the build process, the integration and deployment module may obtain the required dependency packages from a privately configured mirror repository within the company.
[0039] See Figure 5 This is a chart analyzing the efficiency and quality of insurance business data model processing. It shows the entire process from receiving the data to standardization transformation, with key indicators including processing time, error rate, and success rate, intuitively reflecting the efficiency and quality performance at each stage. The peak processing time is during the semantic verification stage, which is the longest because it requires in-depth verification of business terminology compliance and data logic consistency, making it the core bottleneck of the entire process. The peak error rate is during the semantic verification stage, indicating that the complexity of business rules is the main source of problems in model definition. The success rate first decreases and then increases as the stages progress, bottoming out in the semantic verification stage and then gradually recovering in the relation verification and standardization transformation stages, reflecting the gradual correction of problems.
[0040] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. An insurance management system based on a rapid development of a persistence layer code assistance method, characterized by, Includes the following steps: The model processing module receives the insurance business data model definition submitted by the user, performs syntax and semantic verification on the insurance business data model definition, and generates standardized data model description information. The code generation module automatically generates entity class code, data access object interface code, and basic CRUD operation method code corresponding to the database table structure, based on a predefined code template library and standardized data model description information. The mapping and enhancement module parses the signature of the data access object interface code, automatically generates the corresponding structured query language mapping configuration file, maps and associates entity class attributes with database table fields, automatically identifies key business fields in the insurance business data model during the code generation process, and automatically injects business logic verification code fragments into database operations containing the key business fields. The integration and deployment module organizes the automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file according to the preset project structure, and encapsulates them into a persistent layer code package that can be deployed independently. The encapsulated persistent layer code package is then published to the target development environment, and an automated build script is executed to integrate the persistent layer components into the insurance management system under development.
2. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 1, characterized in that, The process involves receiving the insurance business data model definition submitted by the user, performing syntax and semantic checks on the insurance business data model definition, and generating standardized data model description information, specifically as follows: The system receives insurance business data model definitions input by users through a graphical interface or a domain-specific language. The insurance business data model definitions include entity class names, attribute lists, attribute data types, primary key identifiers, and table relationship definitions. Based on a predefined insurance domain meta-model, the entity class names and attribute names in the definition of the insurance business data model are checked for legality to ensure that they comply with programming language naming conventions and insurance industry terminology standards. Verify the correctness of the table relationship definitions in the insurance business data model definition, including whether the definitions of one-to-one, one-to-many, and many-to-many relationships are complete and consistent, and whether foreign key attributes exist and match their types. The validated insurance business data model definition is structurally transformed to extract entity, attribute, relationship, and constraint information, generating standardized data model description information containing complete metadata. The standardized data model description information is described in a specific format.
3. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 2, characterized in that, The system automatically generates entity class code, data access object interface code, and basic CRUD operation method code corresponding to the database table structure, based on a predefined code template library and standardized data model description information. Specifically: Read entity class code templates from the code template library, fill the entity class name, attribute list and attribute data type from the standardized data model description information into the corresponding placeholders in the entity class code template, and generate entity class code containing complete attribute definitions, get methods and set methods; Read the data access object interface code template from the code template library, fill the entity class name and primary key data type from the standardized data model description information into the corresponding placeholders in the data access object interface code template, and generate data access object interface code that declares the methods for adding, deleting, modifying, querying, conditional querying, and pagination querying for entity classes; The code templates for basic operation methods are read from the code template library. The entity class name, attribute name, and primary key name in the standardized data model description information are filled into the corresponding placeholders in the basic operation method code templates to generate persistent logic code that implements the methods such as add, delete, modify, query, conditional query, and pagination query declared in the data access object interface.
4. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 3, characterized in that, The signature of the data access object interface code is parsed to automatically generate the corresponding structured query language mapping configuration file, which maps and associates entity class attributes with database table fields, specifically: Parse all method signatures declared in the generated data access object interface code, and identify the method name, parameter type, return type, and custom query statements declared through annotations; Based on the database table names, field names, primary key names, and field data types defined in the standardized data model description information, a core configuration file describing the mapping relationship between entity classes and database tables is generated. For custom query statements declared through annotations, extract their query logic and convert them into structured query language statements that the database management system can recognize, and configure them in a separate query mapping file; For conditional query and pagination query methods declared in the data access object interface code, the query conditions are automatically derived according to the naming convention of the method name, and a dynamic structured query language fragment configuration is generated. All generated mapping and query configurations are integrated according to preset rules to output a complete Structured Query Language mapping configuration file corresponding to the Data Access Object Interface.
5. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 4, characterized in that, During the code generation process, key business fields in the insurance business data model are automatically identified, and business logic validation code snippets are automatically injected into database operations containing these key business fields. Specifically: When parsing the standardized data model description information, the key business fields in the insurance business data model are identified by matching attribute names or attribute annotations according to the predefined key business field feature library. The key business fields include policy number, insured's ID number, and insurance amount field. When generating method code to perform add or update operations on entity classes containing key business fields, a validation code snippet for verifying the integrity of key business field data and compliance with business rules is automatically inserted inside the method body before the persistence operation is executed. When generating method code to perform query operations on entity classes containing key business fields, post-processing code snippets for data desensitization or formatting of key business fields in the query results are automatically inserted before the query results are returned. The automatically injected validation code snippets and post-processing code snippets are derived from the business rule code snippet library associated with the code template library, and the injection location is determined by the predefined anchor points in the code template.
6. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 5, characterized in that, The automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file are organized according to a preset project structure and packaged into a persistent layer code package that can be deployed independently. Specifically: Based on the preset multi-level project directory structure, the generated entity class code files are placed in the entity class directory, the generated data access object interface code files are placed in the data access object interface directory, the generated basic CRUD operation method code files are placed in the data access object implementation class directory, and the generated structured query language mapping configuration files are placed in the resource mapping file directory. Check whether the reference relationships between code files and configuration files in each directory are correct, including the inheritance and implementation relationships between classes and the reference paths of configuration files; Based on the project dependency management file, generate a dependency description file containing necessary third-party dependency declarations for the persistence layer code package; The well-organized directory structure, code files, configuration files, and dependency description files are compressed and packaged using a packaging tool to generate a persistent layer code package that can be deployed independently.
7. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 6, characterized in that, The process involves publishing the encapsulated persistence layer code package to the target development environment and executing an automated build script to integrate the persistence layer component into the insurance management system under development. Submit the persistent layer code package to the target development environment's code repository using a version control tool, or upload it to the specified server path of the target development environment via a file transfer protocol; In the target development environment, an automated build script is invoked. The automated build script contains instructions for decompressing the persistence layer code package, parsing the dependency description file, downloading third-party dependency libraries, compiling the source code, running unit tests, and packaging to generate an executable component. Execute automated build scripts to compile, test, and build the persistence layer code package, generating persistence layer component library files that meet the requirements of the target development environment; Deploy the successfully built persistent layer component library file to the project dependency path of the insurance management system, and update the project configuration file of the insurance management system to reference the newly integrated persistent layer component; Start the insurance management system to verify whether the persistent layer components can be successfully loaded, and whether the connection to the database and basic operation functions are normal.
8. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 7, characterized in that, Based on the database table names, field names, primary key names, and field data types defined in the standardized data model description information, a core configuration file describing the mapping relationship between entity classes and database tables is generated, specifically: Read the standardized data model description information and extract the entity class names and corresponding database table names defined therein; Extract each attribute name of the entity class and its corresponding database table field name, field data type, whether it is a primary key, and whether it is a nullable field; Based on the extracted information, and following the format specifications of the Structured Query Language mapping configuration file, configuration statements that map entity class attributes to database table fields are generated line by line. For primary key attributes, additional configuration statements for primary key generation strategies are generated. These configuration statements include auto-increment, sequence, and program-specified strategies. The generated entity class and table mapping configuration statements, attribute and field mapping configuration statements, and primary key strategy configuration statements are combined to form a complete core configuration paragraph that describes the mapping relationship between a single entity class and a database table.
9. The insurance management system based on the rapid development of the persistence layer code aided method according to claim 8, characterized in that, When generating method code to perform add or update operations on entity classes containing key business fields, within the method body, before executing the persistence operation, a verification code snippet is automatically inserted to check the integrity of the key business field data and its compliance with business rules. Specifically: During the code generation phase, when traversing the code template for adding or updating methods of entity classes containing key business fields, the preset code injection anchor point in the template before executing the persistence operation statement is located. Based on the list of key business fields identified in the standardized data model description information, data integrity verification rules and business compliance verification rules corresponding to each key business field are retrieved from the business rule code fragment library; The retrieved validation rules are converted into specific conditional statements and exception throwing code statements to form validation code snippets; The generated validation code snippets are inserted into the preset code injection anchor points of the code template according to the validation order of the key business fields in the business logic. Generate the final method code, which includes validation logic for each key business field that is executed sequentially before the persistence operation.
10. The insurance management system based on the rapid development of persistent layer code assistance method according to claim 9, characterized in that, The step of generating a dependency description file containing necessary third-party dependency declarations for the persistent layer code package based on the project dependency management file is as follows: Read the project's preset dependency management file, which defines the coordinates and version ranges of the basic framework dependencies, database driver dependencies, and connection pool dependencies required by the insurance management system's persistence layer; Analyze the application programming interfaces and third-party libraries directly used in the automatically generated entity class code, data access object interface code, basic CRUD operation method code, and structured query language mapping configuration file; The analyzed third-party library dependencies that are directly used are merged with the basic dependencies of the persistence layer defined in the dependency management file, and duplicates are removed to form a complete list of dependencies for the persistence layer code package. Based on the format required by the build tools used in the target development environment, each dependency in the complete persistent layer code package dependency list is converted into a corresponding dependency declaration statement; Write all dependency declarations into a new file to generate the dependency description file for the persistence layer code package.