CN111259067A - Method, device and equipment for realizing DAO interface based on Spring - Google Patents
Method, device and equipment for realizing DAO interface based on Spring Download PDFInfo
- Publication number
- CN111259067A CN111259067A CN202010071423.8A CN202010071423A CN111259067A CN 111259067 A CN111259067 A CN 111259067A CN 202010071423 A CN202010071423 A CN 202010071423A CN 111259067 A CN111259067 A CN 111259067A
- Authority
- CN
- China
- Prior art keywords
- dao interface
- command
- annotation
- dao
- interface class
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The application belongs to the field of data development, and discloses a method, a device and equipment for realizing a DAO interface based on Spring, wherein a preset range of a scanning packet is appointed through a Spring frame, a DAO interface class with preset annotations and FactoryBean are established with a corresponding relation, a corresponding dynamic proxy object is generated and stored in a cache library, if the dynamic proxy object corresponding to the command of the DAO interface class is found, the command is executed, if the dynamic proxy object cannot be found, a corresponding characteristic value is generated according to the command and stored in the cache library, the command is executed, finally if the result set comprises a Convert annotation, the result set is converted into a corresponding target type according to the Convert annotation and then returned, if the result set does not have the Convert annotation, the result set is directly returned, the obtained DAO interface can simultaneously support SQL and HQL, when application construction is carried out, the data is not required to be integrally transferred, and a large amount of XML configuration files can not be generated, the management is simple and convenient, and developers only need to maintain development codes, so that the development efficiency is improved.
Description
Technical Field
The present application relates to the field of data development technologies, and in particular, to a method, an apparatus, and a device for implementing a DAO interface based on Spring.
Background
The DAO schema is one of the standard J2EE (Java 2Platform Enterprise Edition) design schemas, which is used by developers to separate the underlying data access operations from the upper-level business logic, and is called DataAccess Object data access objects in its entirety, and the components of a typical DAO are divided into DAO factory classes, DAO interface classes, specific classes implementing DAO interfaces, and data transfer objects, and the specific DAO classes contain the logic for accessing data from a specific data source.
iBATIS is a Java-enabled persistent layer framework based on SQL (Structured Query Language) mapping. Binding of the DAO interface and an XML (Extensible Markup Language) mapping file is supported, an interface implementation class is automatically generated, and development efficiency is improved.
But also causes the following problems:
(1) iBATIS supports only the SQL structured query language. HQL (Hibernate Query Language) Hibernate Query Language is not supported.
(2) Based on the application constructed on iBATIS, the cost is higher when the integral migration is needed.
(3) The need to write XML mapping files results in a large number of XML configuration files, which makes management difficult.
(4) Developers have to maintain both code and configuration files, and development efficiency becomes low.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, and a device for implementing a DAO interface based on Spring. The method mainly aims to solve the technical problems that the cost for constructing and applying the current system framework is high, more configuration files are generated incidentally, and the development efficiency is influenced.
Based on the above technical problem, a first aspect of the present invention provides a method for implementing a DAO interface based on Spring, where the method includes:
determining a predetermined range of a scan package in a spring.
Scanning the DAO interface class with the preset annotation in the scanning packet in the preset range, and establishing a mapping relation between the FactoryBean and the DAO interface class with the preset annotation;
generating a dynamic proxy object of the DAO interface class with the preset annotation, and storing the dynamic proxy object into a cache library;
receiving a DAO interface class command, searching a corresponding dynamic proxy object from the cache library according to the DAO interface class command, if the dynamic proxy object corresponding to the DAO interface class command is found, executing the DAO interface class command to obtain a result set, otherwise, generating a characteristic value corresponding to the DAO interface class command, storing the characteristic value in the cache library, and executing the DAO interface class command to obtain the result set;
and judging whether the result set contains a Convert annotation, if so, acquiring a target type of a conversion object corresponding to the result set from parameters of the Convert annotation, converting the result set into the target type, and returning the converted result set, otherwise, directly returning the result set.
Further, the determining the predetermined range of the scan packet in the spring.xml configuration file specifically includes:
xml configuration file using the beandefinition registry postprocessor to determine the predetermined range of the scan package;
setting a corresponding annotation name for the scanning packet, wherein the initial annotation name of the scanning packet is set to be AutoDaoImpl;
and matching corresponding entityClass parameters for the AutoDaoImpl, and utilizing the entityClass parameters to correspond to the entity class object of the specific operation of the DAO interface class with the specified annotation.
Further, the scanning of the DAO interface class with the predetermined annotation in the scanning packet in the predetermined range and the establishing of the mapping relationship between the FactoryBean and the DAO interface class with the predetermined annotation specifically include:
scanning DAO interface classes with preset annotations in the scanning packets in the preset range;
defining a ClassPathBeanDefinitionScanner to generate BeanDefinition, defining the mapping relation between FactoryBean and a DAO interface class with a predetermined annotation in the BeanDefinition, and setting a corresponding injection mode for the BeanDefinition.
Further, the generating the dynamic proxy object of the DAO interface class with the predetermined annotation and storing the dynamic proxy object in a cache library specifically includes:
setting the DAO interface class with the preset annotation as a self-defined DAO interface;
and generating a dynamic Proxy object of the user-defined DAO interface by using the Proxy object and the user-defined DAO interface, and storing the dynamic Proxy object into a cache library.
Further, the storing, in the cache library, the feature value corresponding to the command for generating the DAO interface class specifically includes:
acquiring an execution name from the DAO interface type command, and analyzing the execution name to obtain a corresponding return value;
determining corresponding execution parameters according to the execution name, wherein the execution parameters comprise: the method comprises the following steps of (1) commonly-used parameters and callback function parameters, wherein index positions of the callback function parameters are recorded in the callback function parameters;
searching a corresponding execution object from the data according to the execution name;
converting the execution object into a corresponding specific object type by using Convert, wherein the Convert sets the object types of the corresponding conversion of various characteristic values and the conversion scheme of each object type;
and splitting the execution name according to the naming rule of the execution name to obtain a corresponding characteristic value, and storing the characteristic value in the cache library.
Further, the splitting the execution name according to the naming rule of the execution name to obtain a corresponding feature value specifically includes:
splitting the execution name into a prefix, a middle part, a suffix and a keyword according to the naming rule, and taking the prefix, the middle part, the suffix and the keyword obtained by splitting as characteristic values;
wherein the prefix includes, but is not limited to, any one or combination of: saving commands, deleting commands, modifying commands and inquiring commands;
the middle part is a self-defined execution service name;
the suffix includes, but is not limited to, any one or combination of the following: querying all data commands, and according to the ID query command, the multi-attribute correlation query command, the self-defined HQL query command, the self-defined SQL query command and the self-defined SQL logic query command;
the keyword is By, which separates the prefix, middle and suffix.
Further, the executing the command of the DAO interface class to obtain a result set specifically includes:
searching a target characteristic value corresponding to the command of the DAO interface class from the cache library, and determining a corresponding execution logic according to the target characteristic value;
and generating and executing corresponding HQL and SQL sentences according to the execution logic to obtain the result set.
A second aspect of the present invention provides a device for implementing a DAO interface based on Spring, including: the determining module, the scanning module, the generating module, the searching module and the judging module are sequentially connected;
the determining module is used for determining a preset range of the scanning package in a spring.xml configuration file;
the scanning module is used for scanning the DAO interface class with the preset annotation in the scanning packet in the preset range and establishing a mapping relation between the FactoryBean and the DAO interface class with the preset annotation;
the generating module is used for generating the dynamic proxy object of the DAO interface class with the preset annotation and storing the dynamic proxy object into a cache library;
the search module is used for receiving a DAO interface class command, searching a corresponding dynamic proxy object from the cache library according to the DAO interface class command, if the dynamic proxy object corresponding to the DAO interface class command is found, executing the DAO interface class command to obtain a result set, otherwise, generating a characteristic value corresponding to the DAO interface class command, storing the characteristic value in the cache library, and executing the DAO interface class command to obtain the result set;
the judging module is used for judging whether the result set contains the Convert annotation, if so, the target type of the conversion object corresponding to the result set is obtained from the parameters of the Convert annotation, the result set is converted into the target type, the converted result set is returned, and if not, the result set is directly returned.
Further, the determining module specifically includes:
a determining unit for determining a predetermined range of the scan package using the beandefinition registry postprocessor in the spring.xml configuration file;
a setting unit, configured to set a corresponding annotation name for the scan packet, where the initial annotation name of the scan packet is set to be AutoDaoImpl;
and the matching unit is used for matching corresponding entityClass parameters for the AutoDaoImpl, and utilizing the entityClass parameters to correspond to the entity class object of the specific operation of the DAO interface class with the specified annotation.
Further, the scanning module specifically includes:
the scanning unit is used for scanning DAO interface classes with preset annotations in the scanning packets in the preset range;
and the defining unit is used for defining a ClassPathBeanDefinitionScanner to generate BeanDefinition, defining the mapping relation between FactoryBean and a DAO interface class with a predetermined annotation in the BeanDefinition, and setting a corresponding injection mode for the BeanDefinition.
Further, the generating module specifically includes:
the setting unit is used for setting the DAO interface class with the preset annotation into a self-defined DAO interface;
and the generating unit is used for generating a dynamic Proxy object of the user-defined DAO interface by using the Proxy object and the user-defined DAO interface and storing the dynamic Proxy object into a cache library.
Further, the search module specifically includes:
the analysis unit is used for acquiring an execution name from the DAO interface type command, and analyzing the execution name to obtain a corresponding return value;
a parameter determining unit, configured to determine a corresponding execution parameter according to the execution name, where the execution parameter includes: the method comprises the following steps of (1) commonly-used parameters and callback function parameters, wherein index positions of the callback function parameters are recorded in the callback function parameters;
the searching unit is used for searching a corresponding execution object from the data according to the execution name;
the conversion unit is used for converting the execution object into a corresponding specific object type by using Convert, wherein the Convert sets the object type of the corresponding conversion of various characteristic values and the conversion scheme of each object type;
and the splitting unit is used for splitting the execution name according to the naming rule of the execution name to obtain a corresponding characteristic value, and storing the characteristic value in the cache library.
Further, the splitting unit is specifically configured to:
splitting the execution name into a prefix, a middle part, a suffix and a keyword according to the naming rule, and taking the prefix, the middle part, the suffix and the keyword obtained by splitting as characteristic values;
wherein the prefix includes, but is not limited to, any one or combination of: saving commands, deleting commands, modifying commands and inquiring commands;
the middle part is a self-defined execution service name;
the suffix includes, but is not limited to, any one or combination of the following: querying all data commands, and according to the ID query command, the multi-attribute correlation query command, the self-defined HQL query command, the self-defined SQL query command and the self-defined SQL logic query command;
the keyword is By, which separates the prefix, middle and suffix.
Further, the search unit is further configured to search a target feature value corresponding to the command of the DAO interface class from the cache library, and determine a corresponding execution logic according to the target feature value;
the search module further comprises:
and the statement generating unit is used for generating and executing corresponding HQL and SQL statements according to the execution logic to obtain the result set.
According to a third aspect of the present application, there is provided a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method for implementing a DAO interface based on Spring according to the first aspect when executing the computer program.
According to a fourth aspect of the present application, a computer storage medium is provided, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for implementing a DAO interface based on Spring of the first aspect.
By means of the technical scheme, according to the method, the device and the equipment for realizing the DAO interface based on the Spring, the preset range of the scanning package is designated through the Spring frame, the DAO interface class with the preset annotation and the FactoryBean are established to be in a corresponding relation, corresponding dynamic proxy objects are generated and stored in a cache library, then when a programmer needs to use the DAO interface class, a command of the DAO interface class is sent, the dynamic proxy object corresponding to the command is searched from the cache library, if the dynamic proxy object is found, the command is executed, if the dynamic proxy object cannot be found, a corresponding characteristic value is generated according to the command, the command is stored in the cache library, finally the command is executed, if the result set contains the Convert annotation, the result set is required to be converted into a corresponding target type according to the Convert annotation and then returned, and if the result set does not have the Convert annotation, the result set is directly returned. Therefore, the obtained DAO interface can simultaneously support SQL and HQL, when application construction is carried out, data does not need to be integrally migrated, a large number of XML configuration files cannot be generated, management is simple and convenient, developers only need to maintain development codes, and development efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a method for implementing a DAO interface based on Spring in an embodiment of the present application;
FIG. 2 is a timing diagram for the execution of one embodiment of the present application;
fig. 3 is a flowchart of a method for implementing a DAO interface based on Spring in another embodiment of the present application;
fig. 4 is a system block diagram of an apparatus for implementing a DAO interface based on Spring according to still another embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device of the present application.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, a first embodiment of the present application provides a method for implementing a DAO interface based on Spring, including the following steps:
xml configuration file, step 101, determines the predetermined range of the scan packet.
Xml profile is an xml profile under the Spring system framework in this step. And calling xml configuration files under the Spring system framework as required, and designating a preset range corresponding to the required scanning package from all the xml configuration files so as to scan the scanning package according to the preset range.
In this step, since Spring provides a factory class interface of org.
In the step, the obtained DAO interface class with the preset annotation is dynamically analyzed to generate corresponding dynamic proxy objects, each dynamic proxy corresponds to the DAO interface class with the preset annotation one by one, and then the dynamic proxy objects are stored in a cache library for subsequent searching.
And 104, receiving the DAO interface class command, searching a corresponding dynamic proxy object from the cache library according to the DAO interface class command, executing the DAO interface class command to obtain a result set if the dynamic proxy object corresponding to the DAO interface class command is found, otherwise, generating a characteristic value corresponding to the DAO interface class command, storing the characteristic value in the cache library, and executing the DAO interface class command to obtain the result set.
In this step, when the developer wants to use, the developer issues a command of the DAO interface class, and obtains a result set after executing the command according to the above scheme of this step. Therefore, a large amount of XML configuration files cannot be generated in the execution process, and developers can manage the XML configuration files simply and conveniently.
And 105, judging whether the result set contains the Convert annotation, if so, acquiring the target type of the conversion object corresponding to the result set from the parameters of the Convert annotation, converting the result set into the target type, and returning the converted result set, otherwise, directly returning the result set.
In this step, some of the result sets need to be converted into corresponding object types, where an object type is an attribute of each data of the result set, for example, a person is a type, and an individual of each live person is a specific object.
And the type conversion is carried out on the result set, so that the understanding of a developer according to the result set is facilitated, and the development efficiency is further effectively improved.
Through the scheme, a preset range of a scanning package is designated through a Spring frame, a corresponding relation is established between a DAO interface class with a preset annotation and FactoryBean, a corresponding dynamic proxy object is generated and stored in a cache library, then when a programmer needs to use the DAO interface class command is sent, the dynamic proxy object corresponding to the command is searched from the cache library, if the dynamic proxy object is found, the command is executed, if the dynamic proxy object cannot be found, a corresponding characteristic value is generated according to the command and stored in the cache library, the command is executed again, finally if the result set contains a Convert annotation, the result set needs to be converted into a corresponding target type according to the Convert annotation and then is returned, and if the result set does not contain the Convert annotation, the result set is directly returned. Therefore, the obtained DAO interface can simultaneously support SQL and HQL, when the obtained DAO interface is used for application construction, the data does not need to be integrally migrated, the cost is effectively reduced, a large number of XML configuration files cannot be generated when the application construction is carried out, the management is simple and convenient, and developers only need to maintain development codes when later maintenance is carried out, so that the development efficiency is effectively improved.
In a specific embodiment, step 101 specifically includes:
xml configuration file, using the beandefinition registry postprocessor, determines the predetermined range of the scan package, step 1011.
In this step, the BeanDefinitionRegistryPostprocessor inherits from the BeanFactoryPostprocessor, which is a relatively special type of BeanFactoryPostprocessor. The postProcessBeanDefinitionRegistributionmethod defined in the BeanDefinitionRegistrypoProcessExcessor can implement the logic of the customized registration bean definition, and therefore, defines the scanning range of the xml configuration file in the Spring framework by using the BeanDefinitionRegistributPostProcessor.
Step 1012, setting a corresponding annotation name for the scan package, wherein the initial annotation name of the scan package is set to AutoDaoImpl.
In this step, the name AutoDaoImpl may be set by the developer according to the actual needs.
Step 1013, matching corresponding entityClass parameters for the AutoDaoImpl, and using the entityClass parameters to correspond to the entity class object of the specific operation of the DAO interface class with the specified annotation.
In this step, the entityClass parameter refers to an entity classification parameter, and a corresponding entity class object is determined according to a specific execution operation corresponding to the DAO interface class with the specified annotation, so as to ensure that an accurate dynamic proxy object can be generated after dynamic analysis is performed according to the DAO interface class with the specified annotation.
In a specific embodiment, step 102 specifically includes:
step 1021, scanning the DAO interface class with the predetermined annotation in the scanning packet in the predetermined range.
Step 1022, defining a ClassPathBeanDefinitionScanner to generate BeanDefinition, defining a mapping relation between FactoryBean and a DAO interface class with a predetermined annotation in BeanDefinition, and setting a corresponding injection mode for BeanDefinition.
In the above scheme, the class scanner of ClassPathBeanDefinitionScanner is Spring analyzes that the ClassPathBeanDefinitionScanner role is to specify the class under the package.
Filtering the DAO interface class with the preset annotation searched under the specified packet by using a filter, and packaging the mapping relation between the FactoryBean and the DAO interface class with the preset annotation into a form of BeanDefinition and registering the form into the IOC container.
In a specific embodiment, step 103 specifically includes:
and step 1031, setting the DAO interface class with the predetermined annotation as a custom DAO interface.
And 1032, generating a dynamic Proxy object of the user-defined DAO interface by using the Proxy object and the user-defined DAO interface, and storing the dynamic Proxy object into a cache library.
In the above scheme, the Proxy object is 1 Proxy object created by Proxy, and then allows some actions of the specified object to be customized by operating the Proxy object. Therefore, the Proxy object is used for carrying out dynamic self-defining processing on the self-defining DAO interface to generate corresponding dynamic Proxy objects, and the dynamic Proxy objects are stored in the cache library for subsequent searching.
The method specifically comprises the following steps: the Proxy constructor receives 2 objects, the 1 st parameter is the object to be processed (i.e., the custom DAO interface), and the 2 nd parameter is the set of custom processed methods (i.e., the dynamic Proxy object).
In a specific embodiment, step 104 further comprises:
step 1041, obtaining the execution name from the command of the DAO interface class, and analyzing the execution name to obtain the corresponding return value.
In this step, the command of each DAO interface class carries the execution name of the corresponding execution task, and the execution task corresponding to the execution name is parsed to obtain a return value matching the execution task. The type of the return value, such as basic type and object type, is recorded in the return value.
Step 1042, determining corresponding execution parameters according to the execution name, wherein the execution parameters include: the system comprises a common parameter and a callback function parameter, wherein the callback function parameter records the index position of the callback function parameter.
In this step, the execution parameter corresponding to the execution name is determined according to the return value. The common parameter refers to that the execution name is an attribute name of the entity class, and if the entity class is human, the attribute name may be name, age, or the like.
The callback function parameter record index position has the advantage that anonymous internal classes can be flexibly introduced at different positions of the callback function parameter, and the callback function parameter record index position is not limited to specifying a specific introduction position. The user-defined business logic can be implemented using the anonymous inner class.
Step 1043, finding the corresponding execution object from the data according to the execution name.
In this step, each execution name corresponds to a plurality of execution objects.
Step 1044, converting the execution object into a corresponding specific object type by using Convert, wherein the Convert sets the object types corresponding to the conversion of various feature values and the conversion scheme of each object type.
In this step, Convert is a file system modification command, and modification conversion can be performed on the execution object.
Step 1045, according to the naming rule of the execution name, splitting the execution name to obtain a corresponding characteristic value, and storing the characteristic value in the cache library.
In this step, each execution name has a corresponding naming convention, such as front-end why value and back-end why value are set. According to the naming rules of various execution names, the execution names are split into a plurality of parts, the split result is used as a characteristic value, and the characteristic value is associated with the DAO interface class in the DAO interface class command and then stored in a cache library for subsequent searching.
In a specific embodiment, step 1045 specifically includes: and splitting the execution name into a prefix, a middle part, a suffix and a keyword according to a naming rule, and taking the prefix, the middle part, the suffix and the keyword obtained by splitting as characteristic values.
Wherein prefixes include, but are not limited to, any one or combination of the following: save commands, delete commands, modify commands, and query commands.
The middle part is a self-defined execution service name.
Suffixes include, but are not limited to, any one or combination of: querying all data commands, querying commands according to the ID, multi-attribute association query commands, self-defined HQL query commands, self-defined SQL query commands and self-defined SQL logic query commands.
The key word is By, which separates the prefix, middle and suffix.
For example: prefix identification includes, but is not limited to: increase: void saveXXXX (T obj), update: voidupdateXXXX (T obj), add or update: void saveOrUpdateXXXX (T obj), delete: voiddeleteXXXById (Integerid);
suffix designations include, but are not limited to: inquiring according to the ID: t getXXXXById (Integerid), Multi-Attribute Association query: t getXXXXByProperty1AndProperty2(String Property1, int Property2), custom HQL query: t getUniqueXXByHql (String hql, Object [ ] args), custom SQL query: tgetxxxxxbysqlcommand (ISqlCommand < T > sqlCommand), finding and returning the converted object according to the ID: @ converter (clazz ═ XXX. class) XXX getxxxxxbyid (Integerid). In addition. The multi-attribute associated query command in suffix comprises: and, or, non-logical relationships between multiple attributes in an entity class object.
Through the scheme, all the analyzed characteristic values are stored in the cache, so that secondary analysis is avoided, and the processing efficiency is effectively accelerated.
In a specific embodiment, step 104 further comprises:
step 1046, searching a target characteristic value corresponding to the command of the DAO interface class from the buffer library, and determining a corresponding execution logic according to the target characteristic value.
And 1047, generating and executing corresponding HQL and SQL statements according to the execution logic to obtain a result set.
In the above scheme, the cache library stores the feature values corresponding to the DAO interface classes, searches from the cache library according to the command of the DAO interface classes, uses the found feature values as target feature values, where the target feature values include multiple data values, and generates corresponding HQL and SQL statements according to the data values. And then executing processing according to the HQL and SQL sentences, wherein each sentence correspondingly obtains a corresponding processing result, and the results are integrated to form a result set.
And finally, converting all conversion objects capable of performing type conversion on the result set into corresponding target types according to the step 105, and returning the obtained result set to developers for processing.
Through the scheme of the embodiment, the obtained DAO interface can simultaneously support SQL and HQL, when the obtained DAO interface is used for application construction, the data does not need to be integrally migrated, the cost is effectively reduced, a large number of XML configuration files cannot be generated when the application construction is carried out, the management is simple and convenient, and developers only need to maintain development codes when later maintenance is carried out, so that the development efficiency is effectively improved.
Another embodiment of the present application provides a method for implementing a DAO interface based on Spring, and an execution timing diagram is shown in fig. 2.
The execution process of the embodiment includes:
and scanning the DAO interface class with the specified annotation under the specified packet to generate the corresponding relation between the FactoryBean and the DAO interface class.
And generating a DAO dynamic proxy class corresponding to the DAO interface class.
Receiving a method of the DAO interface class (namely, a command of the DAO interface class), judging whether the method exists in the corresponding DAO agent class, if the method is the method for executing the found DAO agent class, returning an execution result (namely, a result set), otherwise, generating a characteristic value of the method of the DAO interface class in the DAO agent class, executing the method and returning the execution result.
When the returned result is executed, if the Convert annotation is indicated in the returned result, the converted class (namely, the target type) is indicated in the Convert parameter, and the result set in the returned result is automatically converted into the specified class.
Firstly, scanning a DAO interface class with a specified annotation under a specified package, in a spring.xml configuration file, specifying the range of the scanned package by using a custom implementation class inheriting a BeanDefinitionRegistryPostprocessor, and specifying an annotation name, wherein the default implemented annotation is AutoDaoImpl (namely, an initial annotation name), and the DAO interface class with the annotation becomes a target to be automatically implemented. The annotation carries an entityClass parameter value that specifies the corresponding entity class object for the DAO interface class operation.
Generating the corresponding relation between FactoryBean and the DAO interface class refers to realizing a ClassPathBeanDefinitionScanner by self-definition to generate BeanDefinition, wherein the BeanDefinition is an example of a bean described in Spring and comprises an attribute value, a construction method parameter value and more information inherited from the class. The FactoryBean and DAO interface is defined in BeanDefinition and the injection mode is set.
A FactoryBean is a factory Bean that returns an object that is not an instance of a specified class, but rather an object returned by the FactoryBean's getObject method. Then in the getObject method, the Proxy object and the custom DAO interface are used to generate a dynamic Proxy object for the interface.
When the method of the DAO interface is called, whether the method exists in the corresponding DAO proxy class or not is judged, the called method name is searched in a method cache, whether the method definition exists or not is judged, and if the method does not exist, the method is analyzed and stored in the cache.
Analyzing the characteristic value of the method comprises analyzing the return value of the method according to the called method name, acquiring method parameters according to the method name, acquiring annotations on the method name and splitting the method name according to the method naming rule.
The return value of the method analyzes the type of the record return value, such as a basic type and an object type.
The method comprises the steps of obtaining parameters of the method, wherein the parameters are divided into general parameters and callback function parameters, the callback function parameters and the index positions of the callback function parameters are recorded. The advantage of recording the index location is that anonymous inner classes can be flexibly imported at different locations of the callback function parameters, without being limited to specifying specific import locations. The user-defined business logic can be implemented using the anonymous inner class.
And acquiring whether the Convert annotation exists on the method name. The Convert annotation provides class conversion capability that converts the result set of the query into a corresponding class object. The clazz parameter in Convert specifies the class object after transformation.
The method name is divided into four parts of a prefix, a middle part, a suffix and a keyword according to rules, and the prefix is marked by storage, deletion, modification and inquiry. The middle part is a self-defined service name. Postscript all data, query according to ID, multi-attribute association query, self-defined HQL query, self-defined SQL query, and self-defined SQL logic query. The keyword is By for distinguishing suffix parts.
For example:
increase: void saveXXXX (T obj);
updating: voidupdateXXXX (T obj);
adding or updating: void saveOrUpdateXXXX (T obj);
and (3) deleting: void delexxxxbyid (integraid);
inquiring according to the ID: t getXXXXById (Integer id);
and multi-attribute association query: t getXXXXByProperty1AndProperty2(String Property1, intProperty 2);
self-defining HQL query: t getUniqueXXByHql (String hql, Object [ ] args);
self-defining SQL query: t getXXXXBySqlCommand (ISqlCommand < T > sqlCommand);
finding and returning the converted object according to the ID:
@Convert(clazz=XXX.class)
XXX getXXXXById(Integerid)。
and storing the analyzed method characteristic value into a cache, so that secondary analysis is avoided, and the processing efficiency is accelerated.
And finding out corresponding execution logic according to the processed characteristic values in the cache each time, generating corresponding HQL and SQL sentences for utilization and execution, and returning to a result set.
As shown in fig. 3, the execution process of this embodiment specifically includes:
the proxy calls an interface method and utilizes Hash to carry out addressing;
searching from a method cache region, and judging whether the interface method exists;
if the characteristic value is not found, inputting a characteristic value analyzer of the interface method, successfully analyzing the interface method after processing through a return value type recorder, a destroyed function position recorder, a keyword analyzer, a conversion type recorder, a conversion type attribute cache region, a hump naming analyzer, an SQL splicer and an HQL splicer, and storing an analysis result in the cache region;
if the result is found, inputting the interface method into a method execution area, and processing the result through a characteristic value analyzer, a method parameter analyzer, an SQL analyzer, an HQL analyzer and a Query processor to obtain a result set;
and inputting the obtained result set into a result set converter for conversion processing, and then outputting a target result set.
By the scheme of the embodiment, the DAO interface can be automatically realized in an annotation mode without an iBATIS framework, and the effects of zero configuration, no migration problem and SQL and HQL support are realized.
Yet another embodiment of the present application provides a device for implementing a DAO interface based on Spring, as shown in fig. 4, including: the determining module, the scanning module, the generating module, the searching module and the judging module are sequentially connected;
the system comprises a determining module, a scanning module and a processing module, wherein the determining module is used for determining a preset range of a scanning package in a spring.
The scanning module is used for scanning the DAO interface class with the preset annotation in the scanning packet in the preset range and establishing a mapping relation between the FactoryBean and the DAO interface class with the preset annotation;
the generating module is used for generating a dynamic proxy object of the DAO interface class with a preset annotation and storing the dynamic proxy object into a cache library;
the search module is used for receiving the DAO interface class command, searching the corresponding dynamic proxy object from the cache library according to the DAO interface class command, executing the DAO interface class command to obtain a result set if the dynamic proxy object corresponding to the DAO interface class command is found, otherwise, generating a characteristic value corresponding to the DAO interface class command, storing the characteristic value in the cache library, and executing the DAO interface class command to obtain the result set;
and the judging module is used for judging whether the result set contains the Convert annotation, if so, acquiring the target type of the conversion object corresponding to the result set from the parameters of the Convert annotation, converting the result set into the target type, and returning the converted result set, otherwise, directly returning the result set.
In a specific embodiment, the determining module specifically includes:
a determining unit for determining a predetermined range of the scan package using the beandefinition registry postprocessor in the spring.xml configuration file;
the device comprises a setting unit, a processing unit and a processing unit, wherein the setting unit is used for setting a corresponding annotation name for a scanning packet, and the initial annotation name of the scanning packet is set to be AutoDaoImpl;
and the matching unit is used for matching corresponding entityClass parameters for the AutoDaoImpl, and utilizing the entityClass parameters to correspond to the entity class object of the specific operation of the DAO interface class with the specified annotation.
In a specific embodiment, the scanning module specifically includes:
the scanning unit is used for scanning DAO interface classes with preset annotations in scanning packets in a preset range;
and the defining unit is used for defining a ClassPathBeanDefinitionScanner to generate BeanDefinition, defining the mapping relation between FactoryBean and a DAO interface class with a predetermined annotation in the BeanDefinition, and setting a corresponding injection mode for the BeanDefinition.
In a specific embodiment, the generating module specifically includes:
the setting unit is used for setting the DAO interface class with the preset annotation into a self-defined DAO interface;
and the generating unit is used for generating a dynamic Proxy object of the user-defined DAO interface by using the Proxy object and the user-defined DAO interface and storing the dynamic Proxy object into the cache library.
In a specific embodiment, the search module specifically includes:
the analysis unit is used for acquiring an execution name from the DAO interface command, analyzing the execution name and obtaining a corresponding return value;
a parameter determining unit, configured to determine a corresponding execution parameter according to the execution name, where the execution parameter includes: the method comprises the following steps of (1) commonly-used parameters and callback function parameters, wherein index positions of the callback function parameters are recorded in the callback function parameters;
the searching unit is used for searching the corresponding execution object from the data according to the execution name;
the conversion unit is used for converting the execution object into a corresponding specific object type by using Convert, wherein the Convert sets the object type corresponding to the conversion of various characteristic values and the conversion scheme of each object type;
and the splitting unit is used for splitting the execution name according to the naming rule of the execution name to obtain a corresponding characteristic value, and storing the characteristic value in the cache library.
In a specific embodiment, the splitting unit is specifically configured to:
splitting the execution name into a prefix, a middle part, a suffix and a keyword according to a naming rule, and taking the prefix, the middle part, the suffix and the keyword obtained by splitting as characteristic values;
wherein prefixes include, but are not limited to, any one or combination of the following: saving commands, deleting commands, modifying commands and inquiring commands;
the middle part is a self-defined execution service name;
suffixes include, but are not limited to, any one or combination of: querying all data commands, and according to the ID query command, the multi-attribute correlation query command, the self-defined HQL query command, the self-defined SQL query command and the self-defined SQL logic query command;
the key word is By, which separates the prefix, middle and suffix.
In a specific embodiment, the searching unit is further configured to search a target feature value corresponding to the command of the DAO interface class from the buffer library, and determine a corresponding execution logic according to the target feature value;
the search module further comprises:
and the statement generating unit is used for generating and executing corresponding HQL and SQL statements according to the execution logic to obtain a result set.
Based on the foregoing embodiments of the method and apparatus for implementing a DAO interface based on Spring, in order to achieve the foregoing object, an embodiment of the present application further provides a computer device, as shown in fig. 5, where the computer device includes a memory and a processor, where the memory and the processor are both disposed on a bus, the memory stores a computer program, and the processor implements the method for implementing a DAO interface based on Spring shown in fig. 1 when executing the computer program.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile memory (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the implementation scenarios of the present application.
Optionally, the device may also be connected to a user interface, a network interface, a camera, Radio Frequency (RF) circuitry, sensors, audio circuitry, a WI-FI module, and so forth. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., a bluetooth interface, WI-FI interface), etc.
Those skilled in the art will appreciate that the configuration of a computer device provided in the present embodiment does not constitute a limitation of the physical device, and may include more or less components, or some components in combination, or a different arrangement of components.
Based on the above embodiments of the method shown in fig. 1and the apparatus shown in fig. 4, correspondingly, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for implementing a DAO interface based on Spring as shown in fig. 1 is implemented.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware.
By applying the technical scheme of the application, a preset range of a scanning package is designated by using a Spring frame, a corresponding relation is established between a DAO interface class with a preset annotation and FactoryBean, a corresponding dynamic proxy object is generated and stored in a cache library, then when a programmer needs to use the DAO interface class, a command of the DAO interface class is sent, the dynamic proxy object corresponding to the command is searched from the cache library, if the dynamic proxy object is found, the command is executed, if the dynamic proxy object cannot be found, a corresponding characteristic value is generated according to the command and stored in the cache library, the command is executed, finally, if the result set contains a Convert annotation, the result set is converted into a corresponding target type according to the Convert annotation and then returned, and if the result set does not contain the Convert annotation, the result set is directly returned. Therefore, the obtained DAO interface can simultaneously support SQL and HQL, when application construction is carried out, data does not need to be integrally migrated, a large number of XML configuration files cannot be generated, management is simple and convenient, developers only need to maintain development codes, and development efficiency is improved.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.
Claims (10)
1. A method for realizing a DAO interface based on Spring is characterized by comprising the following steps:
determining a predetermined range of a scan package in a spring.
Scanning the DAO interface class with the preset annotation in the scanning packet in the preset range, and establishing a mapping relation between the FactoryBean and the DAO interface class with the preset annotation;
generating a dynamic proxy object of the DAO interface class with the preset annotation, and storing the dynamic proxy object into a cache library;
receiving a DAO interface class command, searching a corresponding dynamic proxy object from the cache library according to the DAO interface class command, if the dynamic proxy object corresponding to the DAO interface class command is found, executing the DAO interface class command to obtain a result set, otherwise, generating a characteristic value corresponding to the DAO interface class command, storing the characteristic value in the cache library, and executing the DAO interface class command to obtain the result set;
and judging whether the result set contains a Convert annotation, if so, acquiring a target type of a conversion object corresponding to the result set from parameters of the Convert annotation, converting the result set into the target type, and returning the converted result set, otherwise, directly returning the result set.
2. The method according to claim 1, wherein the determining the predetermined range of the scan packets in a spring.
Xml configuration file using the beandefinition registry postprocessor to determine the predetermined range of the scan package;
setting a corresponding annotation name for the scanning packet, wherein the initial annotation name of the scanning packet is set to be AutoDaoImpl;
and matching corresponding entityClass parameters for the AutoDaoImpl, and utilizing the entityClass parameters to correspond to the entity class object of the specific operation of the DAO interface class with the specified annotation.
3. The method according to claim 1, wherein the scanning of the DAO interface class with the predetermined annotation in the scanning packet in the predetermined range and the establishing of the mapping relationship between the FactoryBean and the DAO interface class with the predetermined annotation specifically include:
scanning DAO interface classes with preset annotations in the scanning packets in the preset range;
defining a ClassPathBeanDefinitionScanner to generate BeanDefinition, defining the mapping relation between FactoryBean and a DAO interface class with a predetermined annotation in the BeanDefinition, and setting a corresponding injection mode for the BeanDefinition.
4. The method according to claim 1, wherein the generating the dynamic proxy object of the DAO interface class with the predetermined annotation and storing the dynamic proxy object in a cache library specifically includes:
setting the DAO interface class with the preset annotation as a self-defined DAO interface;
and generating a dynamic Proxy object of the user-defined DAO interface by using the Proxy object and the user-defined DAO interface, and storing the dynamic Proxy object into a cache library.
5. The method according to claim 1, wherein the storing, in the cache library, the feature value corresponding to the command for generating the DAO interface class specifically includes:
acquiring an execution name from the DAO interface type command, and analyzing the execution name to obtain a corresponding return value;
determining corresponding execution parameters according to the execution name, wherein the execution parameters comprise: the method comprises the following steps of (1) commonly-used parameters and callback function parameters, wherein index positions of the callback function parameters are recorded in the callback function parameters;
searching a corresponding execution object from the data according to the execution name;
converting the execution object into a corresponding specific object type by using Convert, wherein the Convert sets the object types of the corresponding conversion of various characteristic values and the conversion scheme of each object type;
and splitting the execution name according to the naming rule of the execution name to obtain a corresponding characteristic value, and storing the characteristic value in the cache library.
6. The method according to claim 5, wherein the splitting the execution name according to the naming rule of the execution name to obtain a corresponding feature value specifically comprises:
splitting the execution name into a prefix, a middle part, a suffix and a keyword according to the naming rule, and taking the prefix, the middle part, the suffix and the keyword obtained by splitting as characteristic values;
wherein the prefix includes, but is not limited to, any one or combination of: saving commands, deleting commands, modifying commands and inquiring commands;
the middle part is a self-defined execution service name;
the suffix includes, but is not limited to, any one or combination of the following: querying all data commands, and according to the ID query command, the multi-attribute correlation query command, the self-defined HQL query command, the self-defined SQL query command and the self-defined SQL logic query command;
the keyword is By, which separates the prefix, middle and suffix.
7. The method of claim 1, wherein the executing the command of the DAO interface class to obtain a result set specifically comprises:
searching a target characteristic value corresponding to the command of the DAO interface class from the cache library, and determining a corresponding execution logic according to the target characteristic value;
and generating and executing corresponding HQL and SQL sentences according to the execution logic to obtain the result set.
8. A device for realizing a DAO interface based on Spring is characterized by comprising: the determining module, the scanning module, the generating module, the searching module and the judging module are sequentially connected;
the determining module is used for determining a preset range of the scanning package in a spring.xml configuration file;
the scanning module is used for scanning the DAO interface class with the preset annotation in the scanning packet in the preset range and establishing a mapping relation between the FactoryBean and the DAO interface class with the preset annotation;
the generating module is used for generating the dynamic proxy object of the DAO interface class with the preset annotation and storing the dynamic proxy object into a cache library;
the search module is used for receiving a DAO interface class command, searching a corresponding dynamic proxy object from the cache library according to the DAO interface class command, if the dynamic proxy object corresponding to the DAO interface class command is found, executing the DAO interface class command to obtain a result set, otherwise, generating a characteristic value corresponding to the DAO interface class command, storing the characteristic value in the cache library, and executing the DAO interface class command to obtain the result set;
the judging module is used for judging whether the result set contains the Convert annotation, if so, the target type of the conversion object corresponding to the result set is obtained from the parameters of the Convert annotation, the result set is converted into the target type, the converted result set is returned, and if not, the result set is directly returned.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the Spring-based method of implementing a DAO interface according to any of claims 1 to 7.
10. A computer storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of implementing a DAO interface based on Spring according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010071423.8A CN111259067B (en) | 2020-01-21 | 2020-01-21 | Method, device and equipment for realizing DAO interface based on Spring |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010071423.8A CN111259067B (en) | 2020-01-21 | 2020-01-21 | Method, device and equipment for realizing DAO interface based on Spring |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111259067A true CN111259067A (en) | 2020-06-09 |
CN111259067B CN111259067B (en) | 2023-06-06 |
Family
ID=70950980
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010071423.8A Active CN111259067B (en) | 2020-01-21 | 2020-01-21 | Method, device and equipment for realizing DAO interface based on Spring |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111259067B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111752601A (en) * | 2020-06-19 | 2020-10-09 | 贝壳技术有限公司 | Data configuration method, device and system, electronic equipment and storage medium thereof |
CN111831318A (en) * | 2020-06-30 | 2020-10-27 | 山东大学 | Micro-service management system capable of automatically generating codes and code generation method |
CN113377353A (en) * | 2021-05-11 | 2021-09-10 | 北京沃东天骏信息技术有限公司 | Interface scanning method and device and storage medium |
CN113986338A (en) * | 2021-12-28 | 2022-01-28 | 深圳市明源云科技有限公司 | Project package scanning method, system, equipment and computer readable storage medium |
WO2023098241A1 (en) * | 2021-12-03 | 2023-06-08 | 深圳前海微众银行股份有限公司 | Request processing method and apparatus |
CN116501415A (en) * | 2023-06-30 | 2023-07-28 | 英诺达(成都)电子科技有限公司 | Command execution method and device, electronic equipment and computer readable storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030023601A1 (en) * | 2001-05-08 | 2003-01-30 | Fortier Joseph W. | System and method for intercommunication among disparate communication networks |
US20100223385A1 (en) * | 2007-02-02 | 2010-09-02 | The Mathworks, Inc. | Scalable architecture |
CN102819588A (en) * | 2012-08-06 | 2012-12-12 | 南京中兴软创科技股份有限公司 | Dynamic data processing method applied to Oracle database |
US20130110799A1 (en) * | 2011-10-31 | 2013-05-02 | Sally Blue Hoppe | Access to heterogeneous data sources |
CN105138646A (en) * | 2015-08-26 | 2015-12-09 | 浪潮集团有限公司 | Database operation method based on Hibernate |
CN105373536A (en) * | 2014-08-19 | 2016-03-02 | 阿里巴巴集团控股有限公司 | DAO interface realizing method and device |
CN105447151A (en) * | 2015-11-27 | 2016-03-30 | 深圳市金蝶友商电子商务服务有限公司 | Method for accessing distributed database, data source proxy apparatus and application server |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | MVC frame based on Spring and MyBatis |
US20180357055A1 (en) * | 2017-06-07 | 2018-12-13 | Syntel, Inc. | System and method for computer language migration |
CN110046170A (en) * | 2019-04-22 | 2019-07-23 | 深圳乐信软件技术有限公司 | Sentence based on multifile management executes method, apparatus, equipment and medium |
-
2020
- 2020-01-21 CN CN202010071423.8A patent/CN111259067B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030023601A1 (en) * | 2001-05-08 | 2003-01-30 | Fortier Joseph W. | System and method for intercommunication among disparate communication networks |
US20100223385A1 (en) * | 2007-02-02 | 2010-09-02 | The Mathworks, Inc. | Scalable architecture |
US20130110799A1 (en) * | 2011-10-31 | 2013-05-02 | Sally Blue Hoppe | Access to heterogeneous data sources |
CN102819588A (en) * | 2012-08-06 | 2012-12-12 | 南京中兴软创科技股份有限公司 | Dynamic data processing method applied to Oracle database |
CN105373536A (en) * | 2014-08-19 | 2016-03-02 | 阿里巴巴集团控股有限公司 | DAO interface realizing method and device |
CN105138646A (en) * | 2015-08-26 | 2015-12-09 | 浪潮集团有限公司 | Database operation method based on Hibernate |
CN105447151A (en) * | 2015-11-27 | 2016-03-30 | 深圳市金蝶友商电子商务服务有限公司 | Method for accessing distributed database, data source proxy apparatus and application server |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | MVC frame based on Spring and MyBatis |
US20180357055A1 (en) * | 2017-06-07 | 2018-12-13 | Syntel, Inc. | System and method for computer language migration |
CN110046170A (en) * | 2019-04-22 | 2019-07-23 | 深圳乐信软件技术有限公司 | Sentence based on multifile management executes method, apparatus, equipment and medium |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111752601A (en) * | 2020-06-19 | 2020-10-09 | 贝壳技术有限公司 | Data configuration method, device and system, electronic equipment and storage medium thereof |
CN111831318A (en) * | 2020-06-30 | 2020-10-27 | 山东大学 | Micro-service management system capable of automatically generating codes and code generation method |
CN113377353A (en) * | 2021-05-11 | 2021-09-10 | 北京沃东天骏信息技术有限公司 | Interface scanning method and device and storage medium |
WO2023098241A1 (en) * | 2021-12-03 | 2023-06-08 | 深圳前海微众银行股份有限公司 | Request processing method and apparatus |
CN113986338A (en) * | 2021-12-28 | 2022-01-28 | 深圳市明源云科技有限公司 | Project package scanning method, system, equipment and computer readable storage medium |
CN116501415A (en) * | 2023-06-30 | 2023-07-28 | 英诺达(成都)电子科技有限公司 | Command execution method and device, electronic equipment and computer readable storage medium |
CN116501415B (en) * | 2023-06-30 | 2023-09-22 | 英诺达(成都)电子科技有限公司 | Command execution method and device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111259067B (en) | 2023-06-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111259067B (en) | Method, device and equipment for realizing DAO interface based on Spring | |
US8447744B2 (en) | Extensibility platform using data cartridges | |
US8959106B2 (en) | Class loading using java data cartridges | |
US8019791B2 (en) | Method and system for transforming metadata modeled in the common information model into grid control target metadata | |
JP2019053729A (en) | Test method and test apparatus of smart contract | |
CN109710220B (en) | Relational database query method, relational database query device, relational database query equipment and storage medium | |
US20110078203A1 (en) | System and method for application navigation | |
CN112860265B (en) | Method and device for detecting abnormal operation of source code database | |
CN112579610A (en) | Multi-data source structure analysis method, system, terminal device and storage medium | |
CN114356971A (en) | Data processing method, device and system | |
CN110941629A (en) | Metadata processing method, device, equipment and computer readable storage medium | |
KR102400201B1 (en) | Interworking method between oneM2M to NGSI-LD standard platforms using semantic ontology | |
CN112970011B (en) | Pedigree in record query optimization | |
US7818337B2 (en) | System and method for dynamically exposing SQL statements as web protocols | |
CN114153547B (en) | Management page display method and device | |
CN116594628A (en) | Data tracing method and device and computer equipment | |
US11941465B2 (en) | File discovery on a data storage device based on a filesystem location of microservices | |
CN113343036B (en) | Data blood relationship analysis method and system based on key topological structure analysis | |
CN112799638B (en) | Non-invasive rapid development method, platform, terminal and storage medium | |
CN114281842A (en) | Method and device for sub-table query of database | |
CN114036178A (en) | Service interface generation method, device, computer and readable storage medium | |
CN117093597B (en) | Data processing method and device | |
CN113157726B (en) | Database processing method and device | |
US20240330286A1 (en) | Apparatus, method and storage medium for database query | |
CN114338240B (en) | Vulnerability scanning method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |