Field adjustment method, device, apparatus and storage medium
Patent Information
- Application Number
- CN202410147939.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-01-31
AI Technical Summary
[0002]相关技术中,Java项目在业务场景中,在实体类的字段通常使用字符串常量硬编码来表示实体类的字段名,由于业务数据存储的数据库字段名不同或者业务字段变更导致相关业务代码可能存在遗漏修改问题,从而影响线上业务正常使用
[0009]In this embodiment, since there is a correspondence between the lambda expression and the field alias, the field name is represented by the lambda expression instead of the string. The field that needs to be adjusted is found and adjusted. This can more flexibly adapt to changes in business requirements, reduce code maintenance costs, avoid exceptions caused by missing code changes, and has better compatibility. It can also execute extended classes to adapt to different data source implementations.
Smart Images

Figure CN118113732B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a field adjustment method, apparatus, device, and storage medium. Background Technology
[0002] In related technologies, Java projects often use string constants to hard-code the field names of entity classes in business scenarios. Due to differences in database field names for business data storage or changes in business fields, there may be omissions in the relevant business code, which may affect the normal use of online business. Summary of the Invention
[0003] Based on the above problems, embodiments of this application provide a field adjustment method, apparatus, device, and storage medium.
[0004] The technical solution provided in this application is as follows:
[0005] This application first provides a field adjustment method, the method comprising: obtaining a field editing instruction, the field editing instruction carrying a lambda expression, the lambda expression having a corresponding relationship with a field alias; generating an editing statement based on the lambda expression; and adjusting the fields in an entity class based on the editing statement.
[0006] This application embodiment also provides a field adjustment device, the device comprising: an acquisition module for acquiring field editing instructions, wherein the field editing instructions carry a lambda expression and the lambda expression corresponds to a field alias; a generation module for generating an editing statement based on the lambda expression; and an adjustment module for adjusting fields in an entity class based on the editing statement.
[0007] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the steps in the field adjustment method described in this application.
[0008] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the field adjustment method described in this application.
[0009] In this embodiment, since there is a correspondence between the lambda expression and the field alias, the field name is represented by the lambda expression instead of the string. The field that needs to be adjusted is found and adjusted. This can more flexibly adapt to changes in business requirements, reduce code maintenance costs, avoid exceptions caused by missing code changes, and has better compatibility. It can also execute extended classes to adapt to different data source implementations. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a field adjustment method according to an embodiment of this application;
[0011] Figure 2 This is a flowchart illustrating another field adjustment method according to an embodiment of this application;
[0012] Figure 3 This is a flowchart illustrating another field adjustment method according to an embodiment of this application;
[0013] Figure 4 This is a flowchart illustrating another field adjustment method according to an embodiment of this application;
[0014] Figure 5 A flowchart illustrating a field adjustment method is also provided as an embodiment of this application.
[0015] Figure 6 A flowchart illustrating a field adjustment method is also provided as an embodiment of this application.
[0016] Figure 7 A flowchart illustrating a field adjustment method is also provided as an embodiment of this application.
[0017] Figure 8 This is a UML diagram illustrating the implementation of a field adjustment method according to an embodiment of this application.
[0018] Figure 9 This is a schematic diagram of the composition structure of a field adjustment device according to an embodiment of this application;
[0019] Figure 10 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0020] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0021] Figure 1 This is a flowchart illustrating a field adjustment method according to an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0022] Step 102: Obtain field editing instructions, wherein the field editing instructions carry a lambda expression, and the lambda expression has a corresponding relationship with the field alias;
[0023] Lambda expressions, introduced in JDK 1.8, are a syntax for anonymous functions. Lambda expressions can be understood as a piece of code that can be passed around (passing code like data). This allows for more concise and flexible code writing. Based on this characteristic, "flexible code" can be combined with business logic, enabling modifications to related business logic by changing only one configuration point.
[0024] In entity classes, field names are typically hard-coded using string constants. If a field name is modified, for example, from "sex" to "gender", the hard-coded string constant "sex" is easily overlooked. To avoid this, lambda expressions can be used instead of strings to represent field names. When a field name is renamed, the class-based lambda expression can dynamically obtain the field alias. The function name of the lambda expression can also be renamed. If a field in the entity class is modified, the field in the entity class can be adjusted.
[0025] Step 104: Generate editing statements based on the lambda expression;
[0026] Among them, editing statements can be generated based on the Lambda expression configuration.
[0027] Step 106: Based on the edit statement, adjust the fields in the entity class.
[0028] The edit statement is used to edit the fields in the entity class.
[0029] In this embodiment, since there is a correspondence between the lambda expression and the field alias, the lambda expression is used to replace the string to represent the field alias. The field that needs to be adjusted is found and adjusted. This can more flexibly adapt to changes in business requirements, reduce code maintenance costs, avoid exceptions caused by missing code modifications, and has better compatibility. It can also execute extended classes to adapt to different data source implementations.
[0030] In some embodiments, such as Figure 2 As shown, step 104, "Generate editing statements based on the Lambda expression," includes the following steps:
[0031] Step 1041: Obtain the string alias of the field corresponding to the Lambda expression;
[0032] In the case of the Lambda expression "User::get age", the corresponding string field alias can be "age"; in the case of the Lambda expression "User::get address", the corresponding string field alias can be "address".
[0033] Step 1042: Generate editing statements based on the field aliases.
[0034] The field corresponding to the field alias can be found through the editing statement, and then the corresponding field can be edited.
[0035] In some embodiments, such as Figure 7 As shown, the field editing instructions include one of the following: field add instruction, field delete instruction, field modify instruction, and field query instruction. Correspondingly, the editing statements include one of the following: add statement, delete statement, modify statement, and query statement.
[0036] Step 106, "Adjusting fields in the entity class based on the edit statement," includes:
[0037] Step 1061: If the field editing instruction is a field modification instruction and the editing statement is a modification statement, modify the field in the entity class based on the modification statement.
[0038] In some embodiments, when the field editing instruction is a field lookup instruction and the editing statement is a lookup statement, the field in the entity class is searched based on the lookup statement.
[0039] In this embodiment, by using lambda expressions instead of strings to represent field names, the class-based lambda expression can dynamically obtain field aliases when field names are renamed. The function name of the lambda expression can also be renamed. When a field in the entity class is modified, the field in the entity class that needs to be adjusted can be determined based on the field alias, and the field can be adjusted accordingly. This allows for more flexible adaptation to changes in business requirements, reduces code maintenance costs, avoids exceptions caused by missed code modifications, has better compatibility, and can execute extended classes to adapt to different data source implementations.
[0040] In some embodiments, such as Figure 3 As shown, step 1041, "obtaining the alias of the string type field corresponding to the Lambda expression," includes the following steps:
[0041] Step 10411: Call the writeReplace method to convert the lambda expression into a serializable object;
[0042] Among them, such as Figure 8 As shown in Figure 21, the Serializable interface is the interface that enables serialization. Classes that implement the java.io.Serializable interface are serializable, such as... Figure 8 As shown in Figure 22, the custom functional interface "AvatarSerializedLambda" can inherit the Serializable interface, meaning that the AvatarSerializedLambda interface also supports serialization processing.
[0043] Define some regular expressions, such as "+RETURN_TYPE_PATTERN:Pattern" and "+PARAMETER_TYPE_PATTERN:Pattern", and define a method to get the input parameter types, such as "+getParameterTypes():List". <Class<?> The method to get the response type is "+getReturnType():Class<?>", and the method to get the class type is "+getClassType():Class<?>".
[0044] Java objects with the Serializable interface can be serialized, but only the object's properties are actually serialized; methods (functions) cannot. A lambda expression is a function, and Java can convert a lambda expression that implements the Serializable interface into a SerializableLambda object before performing serialization. An instance class of the AvatarSerializedLambda interface can call the writeReplace() method via reflection, returning a SerializableLambda object. This serialized object contains all the information of the lambda expression, which are the properties of the SerializableLambda, such as the function name, function signature, input parameter types, and output parameter types. Since this information exists as fields, it can be serialized.
[0045] like Figure 8 As shown in 23, a custom Function interface can be defined: EsFunction<T,R> It inherits the custom AvatarSerializedLambda interface. The class corresponding to the Lambda expression implements the Function interface, and thus the class corresponding to the Lambda expression also implements the serializable interface.
[0046] Step 10412: Serialize the serialized object to obtain string-type field aliases.
[0047] Serialization can be a process of converting a serialized object into a string, such as converting a serialized object into a string-type field alias.
[0048] In this embodiment, the lambda expression, which is a function, can be converted into a serializable object before serialization is performed, thereby enabling the retrieval of field aliases based on the lambda expression.
[0049] In some embodiments, such as Figure 4 As shown, the serialized object includes the function name of the lambda expression. Step 10412, "serializing the serialized object to obtain string-type field aliases," includes:
[0050] Using a predefined relational function, the function name is serialized to obtain a string-type field alias.
[0051] like Figure 8 As shown in Figure 24, a relational function "columnToString(EsFunction):String" can be defined, which takes a lambda expression as input and a String as response, thus converting the lambda expression into a string format field alias.
[0052] In this embodiment, a predefined relational function can be used to serialize the function name in the serialization object to obtain a string-type field alias. This allows the field that needs to be adjusted to be found based on the field alias, making it more flexible to adapt to changes in business requirements, reducing code maintenance costs, avoiding exceptions caused by missing code modifications, and providing better compatibility. It can also execute extended classes to adapt to different data source implementations.
[0053] In some embodiments, such as Figure 5 As shown, the serialized object includes the annotation fields of the lambda expression. Step 10412, "serializing the serialized object to obtain string-type field aliases," includes:
[0054] Using a predefined annotation retrieval function, the annotation fields are serialized to obtain string-type field aliases;
[0055] The annotation field is used to explain the field alias corresponding to the lambda expression.
[0056] like Figure 8As shown in 24, an annotation retrieval function "getAnnotationColumn(Field):String" can be defined to retrieve the string type annotation of the Lambda expression. The annotation can indicate the field alias corresponding to the Lambda expression.
[0057] In this embodiment, a predefined annotation retrieval function can be used to serialize the annotation fields in the serialized object to obtain string-type field aliases. This allows for finding and adjusting the fields that need to be adjusted based on the field aliases, enabling more flexible adaptation to changes in business requirements, reducing code maintenance costs, avoiding exceptions caused by missed code modifications, and providing better compatibility. It also allows for the execution of extended classes to adapt to different data source implementations.
[0058] In some embodiments, such as Figure 6 As shown, the serialized object includes the camelCase field of the Lambda expression. Step 10412, "serializing the serialized object to obtain string-type field aliases," includes:
[0059] The camelCase field is serialized using a predefined naming conversion function to obtain a string-type field alias;
[0060] The camelCase field is used to characterize the camelCase naming of fields in the entity class.
[0061] like Figure 8 As shown in 24, a naming conversion function "toUnderlineCase():Boolean" can be defined to obtain the camelCase field in the Lambda expression, wherein the camelCase field represents the camelCase naming of the field in the entity class; the camelCase field is input into the predefined naming conversion function "toUnderlineCase()"; and the string type field alias output by the naming conversion function "toUnderlineCase()" is obtained.
[0062] In this embodiment, a predefined naming conversion function can be used to serialize camelCase fields in a serialized object to obtain string-type field aliases. This allows for finding and adjusting fields that need to be modified based on the field aliases, enabling more flexible adaptation to changes in business requirements, reducing code maintenance costs, avoiding exceptions caused by missed code modifications, and providing better compatibility. It also allows for the execution of extended classes to adapt to different data source implementations.
[0063] Lambda expressions, introduced in JDK 1.8, are a syntax for anonymous functions. Lambda expressions can be understood as passable code (passing code like data), allowing for more concise and flexible code. Based on this characteristic, combining "flexible code" with business logic allows for modifications to related business logic code with only one configuration change.
[0064] Based on the principle of Lambda expression serialization, if the serialized object contains a writePeplace method, a SerializedLambda object can be obtained. From this object, information such as the method name, input parameter type, and output parameter type of the expression can be retrieved. This information can then be combined with business code to achieve flexible handling of code logic.
[0065] This application provides a method for implementing global business adjustments based on Lambda expressions. This method leverages the flexibility and serialization principles of Lambda expressions to perform necessary extensions and optimizations on the business code, achieving the effect of adapting a single adjustment to global business adjustments. The method includes the following steps:
[0066] Step S1: Define a custom SerializedLambda interface that inherits from the Serializable interface. Specify some regular expressions and commonly used methods such as getting input parameter types, response types, and field names. The core is to obtain the writeReplace method based on reflection and execute it to obtain a SerializedLambda object provided by JDK.
[0067] Among them, such as Figure 8 As shown in 21, we can first define an interface (< <interface>>):Serializable, such as Figure 8 As shown in Figure 22, another interface "AvatarSerializedLambda" can be defined, which inherits from the "Serializable" interface. Regular expressions can be specified, such as "+RETURN_TYPE_PATTERN:Pattern" and "+PARAMETER_TYPE_PATTERN:Pattern", as well as a method "+getParameterTypes():List" for retrieving input parameter types. <Class<?> The method to get the response type is "+getReturnType():Class<?>", and the method to get the class type is "+getClassType():Class<?>". The core function is to obtain the writeReplace method based on reflection and execute it to obtain a JDK built-in SerializedLambda object "+getSerializedLambda():SerializedLambda".
[0068] Step S2: Define a Function that inherits from the custom SerializedLambda interface;
[0069] like Figure 8 As shown in section 23, a Function can be defined: EsFunction<T,R> It inherits the custom "AvatarSerializedLambda" interface.
[0070] Step S3: In the business code, for example, if Elasticsearch queries a specified field and only supports the String type, we can extend the query type by encapsulating a method that supports Lambda expression parameters, or by using a utility class method to pass the Lambda expression as the input parameter and the String as the response.
[0071] like Figure 8 As shown in Figure 24, a relational function "columnToString(EsFunction):String" can be defined, taking a lambda expression as input and a String as response, which can convert a lambda expression into a string-formatted field alias. Alternatively, "+getAnnotationColumn(Field)" can be defined to retrieve a string-type annotation of the lambda expression, which indicates the field alias corresponding to the lambda expression. Furthermore, "+toUnderlineCase():Boolean" can be defined to retrieve a camelCase field from the lambda expression, where the camelCase field represents the camelCase naming of the field in the entity class. The camelCase field is input into the predefined naming conversion function "toUnderlineCase()", and the string-type field alias output by the naming conversion function "toUnderlineCase()" is obtained.
[0072] Step S4: Because it is based on Lambda expressions, if a field in the entity class in Elasticsearch is modified, the field in the entity class can be adjusted.
[0073] Among them, Figure 8 After defining the function in section 24, it can be used in, for example... Figure 8 The 25 specific implementations correspond to the functions; such as Figure 8 As shown in Figure 26, which represents a subclass of Boolean, several query methods are listed; such as Figure 8 As shown in 87, XXServiceHelper is a service helper class.
[0074] It should be noted that, in the embodiments of this application, if the above-mentioned field adjustment method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a mobile phone, tablet computer, desktop computer, personal digital assistant, navigator, digital phone, video phone, television, sensing device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0075] Figure 9 This is a schematic diagram of the composition structure of a field adjustment device according to an embodiment of this application, as shown below. Figure 9 As shown, the device 300 includes: an acquisition module 301, a generation module 302, and an adjustment module 303, wherein:
[0076] The acquisition module 301 is used to acquire field editing instructions, wherein the field editing instructions carry a lambda expression and the lambda expression has a corresponding relationship with the field alias;
[0077] Generation module 302 is used to generate editing statements based on the lambda expression;
[0078] The adjustment module 303 is used to adjust the fields in the entity class based on the edit statement.
[0079] In some embodiments, the generation module 302 includes: an acquisition submodule, used to acquire a string-type field alias corresponding to the Lambda expression; and a generation submodule, used to generate an editing statement based on the field alias.
[0080] In some embodiments, the acquisition submodule includes: a conversion unit for calling the writeReplace method to convert the lambda expression into a serialized object; and a processing unit for performing serialization processing on the serialized object to obtain a string-type field alias.
[0081] In some embodiments, the serialization object includes the function name of the lambda expression, and the processing unit includes: a first processing subunit, used to serialize the function name using a predefined relational function to obtain a string-type field alias.
[0082] In some embodiments, the serialization object includes annotation fields of the lambda expression, and the processing unit includes: a second processing subunit, configured to use a predefined annotation retrieval function to serialize the annotation fields to obtain string-type field aliases. The annotation fields are used to explain the field aliases corresponding to the lambda expression.
[0083] In some embodiments, the serialization object includes a camelCase field of the lambda expression, and the processing unit includes: a third processing subunit, used to serialize the camelCase field using a predefined naming conversion function to obtain a string-type field alias; wherein the camelCase field is used to characterize the camelCase naming of fields in the entity class.
[0084] In some embodiments, the field editing instruction includes one of a field add instruction, a field delete instruction, a field modify instruction, and a field query instruction, and the editing statement includes one of an add statement, a delete statement, a modify statement, and a query statement; the adjustment module 303 includes: an adjustment submodule, used to modify the fields in the entity class based on the modification statement when the field editing instruction is a field modify instruction and the editing statement is a modification statement.
[0085] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0086] Based on the foregoing embodiments, this application also provides an electronic device. Figure 10 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application, such as... Figure 10 As shown, the hardware entity of the device 400 includes a memory 401 and a processor 402. The memory 401 stores a computer program that can run on the processor 402. When the processor 402 executes the program, it implements the steps in the field adjustment method in the above embodiments.
[0087] The memory 401 is configured to store instructions and applications executable by the processor 402, and can also cache data to be processed or already processed by the processor 402 and the various modules in the device 400 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).
[0088] Based on the foregoing embodiments, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor of an electronic device, can implement the field adjustment method provided in any of the preceding embodiments.
[0089] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0090] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.
[0091] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0092] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0093] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0094] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0095] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware nodes. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0097] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0099] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0100] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.< / interface>
Claims
1. A field adjustment method, characterized in that, The method includes: Obtain field editing instructions, wherein the field editing instructions carry lambda expressions, and the lambda expressions correspond to field aliases; Based on the lambda expression, generate editing statements; Based on the edit statement, adjust the fields in the entity class.
2. The method according to claim 1, characterized in that, The process of generating editing statements based on the lambda expression includes: Retrieve the string alias of the field corresponding to the Lambda expression; Based on the field alias, generate the editing statement.
3. The method according to claim 2, characterized in that, The step of obtaining the string-type field alias corresponding to the Lambda expression includes: Call the writeReplace method to convert the lambda expression into a serializable object; The serialized object is serialized to obtain a string-type field alias.
4. The method according to claim 3, characterized in that, The serialized object includes the function name of the lambda expression. The serialization process of the serialized object, yielding string-type field aliases, includes: Using a predefined relational function, the function name is serialized to obtain a string-type field alias.
5. The method according to claim 3, characterized in that, The serialized object includes annotation fields of the lambda expression. The serialization process of the serialized object, yielding string-type field aliases, includes: Using a predefined annotation retrieval function, the annotation fields are serialized to obtain string-type field aliases; The annotation field is used to explain the field alias corresponding to the lambda expression.
6. The method according to claim 3, characterized in that, The serialized object includes the camelCase field of the lambda expression. The serialization process of the serialized object, yielding string-type field aliases, includes: The camelCase field is serialized using a predefined naming conversion function to obtain a string-type field alias; The camelCase field is used to characterize the camelCase naming of fields in the entity class.
7. The method according to any one of claims 1 to 6, characterized in that, The field editing instructions include one of the following: field add instructions, field delete instructions, field modify instructions, and field query instructions. Correspondingly, the editing statements include one of the following: add statements, delete statements, modify statements, and query statements. The adjustment of fields in the entity class based on the edit statement includes: When the field editing instruction is a field modification instruction and the editing statement is a modification statement, the field in the entity class is modified based on the modification statement.
8. A field adjustment device, characterized in that, The device includes: The acquisition module is used to acquire field editing instructions, wherein the field editing instructions carry a lambda expression, and the lambda expression corresponds to the field alias; The generation module is used to generate editing statements based on the lambda expression; The adjustment module is used to adjust the fields in the entity class based on the edit statement.
9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the field adjustment method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the field adjustment method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Structured query statement rewriting method and device, equipment and medium
CN113111082A
RPA development field editing diversification method
CN115344248A