CN103294462A - Object mapping processing method, mapping processor and object mapping processing system - Google Patents
Object mapping processing method, mapping processor and object mapping processing system Download PDFInfo
- Publication number
- CN103294462A CN103294462A CN2012100558038A CN201210055803A CN103294462A CN 103294462 A CN103294462 A CN 103294462A CN 2012100558038 A CN2012100558038 A CN 2012100558038A CN 201210055803 A CN201210055803 A CN 201210055803A CN 103294462 A CN103294462 A CN 103294462A
- Authority
- CN
- China
- Prior art keywords
- mapping
- source
- attribute
- module
- data
- 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.)
- Pending
Links
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses an object mapping processing method, a mapping processor and an object mapping processing system, wherein the object mapping processing method comprises the following steps: receiving a source object and a target object submitted by a client side; inquiring mapping rules corresponding to the types of the source object and the target object, wherein the mapping rules are set according to a setting command received by the client side, and comprise source attribute information and target attribute information; determining an extraction operation corresponding to the source attribute information and setting an operation corresponding to the target attribute information; acquiring the attribute values of all the attributes of the source object through the determined extraction operation; and setting the attribute values on the target object through the determined setting operation. Through the application of the scheme, the mapping rules of the source object and the target object are self-defined by the client side, and the mapping of all the attributes is completed through the extraction operation and the setting operation that are corresponding to the mapping rules, so that the mapping processing method can support the mapping of different attribute names.
Description
Technical field
The application relates to data processing field, in particular to a kind of object map disposal route, mapping processor and object map disposal system.
Background technology
Present operation system, some medium-and-large-sized operation systems particularly, the hierarchical design of system often all can be taked model-view-control (Model-View-Control, abbreviate MVC as), domain model (Domain Model) drives, and several modes such as SOA design, wherein, design between each layering or the module reduces the dependence of data object between the layering in order to reduce coupling as far as possible.Such as, for MVC, the form data that the page is submitted to is the Map object in the web container time, can be converted to corresponding Form Bean in the processing of View layer, the View layer can submit to data to arrive Control, if according to the domain model design, can be converted to this moment such as corresponding domain object etc.Along with development and the system reconfiguration of system business, the transforming relationship of data object also can become complicated unusually between the corresponding system, changes such as name, and type changes, isomeric data etc.
A kind of method is provided in the prior art, and this method comprises following object map process based on the BeanUtils instrument:
Step S1, the needs that receive the client transmission carry out source object (src) and the destination object (target) of object map;
Step S2, corresponding source object (src) and the corresponding attribute of destination object (target) of scanning respectively;
Step S3 is benchmark with destination object (target) attribute, the attribute assignment of the same name under the corresponding source object (src) is given the attribute of destination object (target) by reflection.If source object in the assignment procedure (src) is different with both types of destination object (target) attribute, then transform (being confined to specific conversion in type) automatically.
Because BeanUtils is based on the bean analysis tool of the Introspector that jdk carries, the Introspector analysis tool can be at the attribute information of the overall analytic target of current class object, and the attribute information that obtains object in real time shines upon processing.Be subject to analysis tool, can't personalized self-defining parsing class, such as the method name that specified attribute is handled, the attribute type of appointment etc. simultaneously, can't be supported the mapping of dynamic attribute, such as Map (Key-Value key assignments).
Be subject to the Introspector analysis tool, the disposal route of the object map that BeanUtils provides is based on autoscan and analyzes corresponding destination object, realize the mapping process of data object based on attribute of the same name, and mapping ruler can not be revised, so there is following limitation in the use: (1) does not support the mapping between the different attribute name; (2) do not support mapping between the dynamic attribute; (3) do not support the attribution method name heavy duty to occur; (4) do not support the mapping of not having attribution method to handle; And (5) do not support n: 1 or 1: the mapping relations of n etc.
Can't handle the problem of shining upon between the source object of different attribute name and the destination object at the disposal route of object map in the correlation technique, not propose effective solution at present as yet.
Summary of the invention
The application's fundamental purpose is to provide a kind of object map disposal route, mapping processor and object map disposal system, can't handle the problem of shining upon between the different attribute name with the disposal route that solves object map.
To achieve these goals, an aspect according to the application provides a kind of object map disposal route.Object map disposal route according to the application comprises: receive source object and destination object that client is submitted to; Inquire about corresponding with source object type and destination object type mapping ruler, wherein, mapping ruler arranges order setting according to what client received, and mapping ruler comprises source attribute information and target property information; Determine the extraction operation corresponding with the source attribute information, the setting operation corresponding with target property information; Obtain the property value of each attribute of source object by the extraction operation of determining; And by the setting operation of determining property value is set on the destination object.
To achieve these goals, according to the application on the other hand, provide a kind of mapping processor.Mapping processor according to the application is used for carrying out any one object map disposal route that the application proposes.
To achieve these goals, the another aspect according to the application provides a kind of mapping processor.This mapping processor comprises: receiver module is used for receiving source object and the destination object that client is submitted to; Enquiry module, be used for inquiry corresponding with source object type and destination object type mapping ruler, wherein, mapping ruler comprises source attribute information and target property information by the client setting; First determination module is used for determining the extraction operation corresponding with the source attribute information, the setting operation corresponding with target property information; Acquisition module is for the property value that obtains each attribute of source object by the extraction operation of determining; And module is set, be used for by the setting operation of determining property value being set to destination object.
To achieve these goals, another aspect according to the application, a kind of object map disposal system is provided, this mapping disposal system comprises: any mapping processor that client and the application provide, wherein, this client comprises: module is set, is used for according to the order that arranges that receives mapping ruler being set, wherein, mapping ruler comprises source attribute information, target property information and plug-in unit Rule Information; And first calling module, being used for calling mapping processor, and submitting to first source object and first destination object to mapping processor, mapping processor is for the treatment of the mapping process of first source object and first destination object.
Pass through the application, the disposal route of the object map that employing the application provides, mapping ruler is self-defined by client, after inquiring the mapping ruler corresponding with source object type and destination object type, determine the extraction operation corresponding with source attribute information in the mapping ruler, and obtain the property value of source object by this extraction operation, take different extraction operations according to the source attribute information of different mappings rule, support dissimilar object map with this, and the situation of using with of different object; Then by the setting operation corresponding with target property information in the mapping ruler, the property value that gets access to is set to destination object, wherein, the setting operation at this place is corresponding with the target property information in the mapping ruler, adopts different setting operations according to the different target attribute information.After each attribute execution above-mentioned extraction operation and setting operation, finish the mapping of all properties, also namely finish source object to the mapping of destination object.In whole mapping process, need not to obtain mapping ruler by scan source object and destination object, the source object attribute does not rely on attribute-name to the assignment of destination object attribute, make the application's object map disposal route can support the mapping of source object attribute and the destination object attribute of different attribute name, the disposal route that has solved object map can't be handled the problem of shining upon between the source object of different attribute name and the destination object, and then the disposal route that has reached object map can be handled the source object of different attribute name and the effect of the mapping between the destination object.
Description of drawings
In order to be illustrated more clearly in the embodiment of the present application or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, the accompanying drawing that describes below only is some embodiment that put down in writing among the application, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.In the accompanying drawings:
Fig. 1 is the theory diagram according to the object map disposal system of the application first embodiment;
Fig. 2 is the theory diagram according to the object map disposal system of the application second embodiment;
Fig. 3 is the theory diagram according to the mapping processor of the embodiment of the present application;
Fig. 4 is the process flow diagram according to the object map disposal route of the application first embodiment;
Fig. 5 is the synoptic diagram according to the object map disposal route of the application second embodiment; And
Fig. 6 is the sequential chart according to the object map disposal route of the application second embodiment.
Embodiment
In order to make those skilled in the art person understand technical scheme among the application better, below in conjunction with the accompanying drawing in the embodiment of the present application, technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment only is the application's part embodiment, rather than whole embodiment.Based on the embodiment among the application, the every other embodiment that those of ordinary skills obtain should belong to the scope that the application protects.
At first, the object map disposal system to the embodiment of the present application describes.
Fig. 1 is the theory diagram according to the object map disposal system of the application first embodiment, and as shown in Figure 1, this system comprises: client 20 and mapping processor 40, wherein, client 20 comprises: module 22 and first calling module 24 are set.
Wherein, module 22 is set is used for according to the order that arranges that receives mapping ruler being set, also be client according to the order that arranges of the user's input that receives, carry out the mapping ruler definition dynamically, support perhaps defines based on programmatic method based on the definition of xml file configuration.Client defines dissimilar mapping rulers according to the mapping business demand, and the mapping ruler that defines is stored, and can store based on the storage mode of current internal memory.
Particularly, the main contents that comprise of mapping ruler have:
Source attribute information: attribute-name, attribute type, attribute place class, the nested attribute type of aggregate attribute;
Target property information: attribute-name, attribute type, attribute place class, the nested attribute type of aggregate attribute.
For example, source attribute information: fieldA, numeric type; Target property information, fieldB, character string type.
When client 20 exists the source object that need shine upon processing and destination object, first calling module 24 calls mapping processor 40, and first source object and first destination object that needs shine upon processing be committed to mapping processor 40 as parameter, the destination object of this moment can be without any property value.
Mapping processor 40 is finished mapping process for the treatment of the mapping of first source object and first destination object.Wherein, this mapping processor 40 is at first inquired about the mapping ruler corresponding with the first source object type and the first destination object type, determine corresponding Get operation (namely extracting operation) and Set operation (being setting operation) according to the mapping ruler that inquires then, finish the mapping of first source object and first destination object by the operation of determining.
For example: the type of first source object is map, when the type of first destination object is Java Pojo Bean, the mapping ruler that should be (map:bean) mutually that inquires, the Get that determines is operating as MapGetExecutor (obtaining realization based on the data of map), and the Set that determines is operating as PropertySetExecutor (the data assignment based on Pojo Bean realizes).
In this embodiment, by client 20 arrange module 22 according to the mapping business demand, pre-defined mapping ruler.When realizing object map, first calling module 24 is submitted to mapping processor 40 with source object and destination object, and mapping processor 40 is obtained predefined mapping ruler according to source object type and destination object type, carries out follow-up mapping and handles.
Use the technical scheme that this embodiment provides, when object map, the mapping ruler of finishing the mapping process needs is self-defined by client, and the mapping disposal system that makes this embodiment provide can be supported the mapping between the dynamic attribute; Mapping processor is querying condition with the type of mapping object, the corresponding rule of inquiry in existing a plurality of mapping rulers, determine map operation according to the mapping ruler that inquires, finishing mapping handles, in whole mapping process, attribute assignment between source object and the destination object does not rely on attribute-name, and the mapping disposal system that makes this embodiment provide can be supported the mapping between the different attribute name of source object and destination object.
For the dissimilar conversion that solves source object and destination object and the conversion of isomeric data, preferably, the mapping ruler of client 20 definition also comprises the plug-in unit Rule Information, and is concrete, and the plug-in unit Rule Information comprises isomeric data processing configuration and the configuration of conversion in type device.Mapping processor 40 is according to the plug-in unit Rule Information in the mapping ruler that inquires, determine corresponding ValuePrcocess plug-in unit (being that data are handled plug-in unit), utilize this ValuePrcocess plug-in unit that the property value of the source object of Get operation extraction is carried out the data processing, the property value after the ValuePrcocess plug-in unit is handled in the Set operation is set to target to picture.
Adopt this preferred embodiment, in the mapping processing procedure, introduced the processing of ValuePrcocess plug-in unit, can support the conversion of isomeric data, can reserve corresponding expansion interface simultaneously, handle to solve isomeric data unknown in the subsequent treatment.
In order to improve the high efficiency of mapping process, preferably, this embodiment also provides second embodiment of object map disposal system, Fig. 2 is the theory diagram according to the object map disposal system of the application second embodiment, this object map disposal system is compared with the object map disposal system among first embodiment, also comprise logging modle 60 and generation module 80, wherein, client 20 also comprises second calling module 26.
On the basis of first embodiment, in the process that mapping processor 40 is handled the picture mapping, the outcome record that 60 pairs of map operations of logging modle are carried out.After collecting the map information of finishing by logging modle 60, the result of 80 pairs of logging modles of generation module, 40 records compiles, generate interim mapping by the compiling of dynamic byte sign indicating number and handle object, this interim mapping is handled object and can be handled follow-up object map.
When existing, client 20 need shine upon second source object and second destination object of processing, and the type of second source object is identical with the type of first source object, when the type of second destination object and first destination object is identical, when also the mapping ruler that namely mapping ruler of second source object and the second destination object correspondence and first source object and first destination object are corresponding is identical, second calling module 26 calls the interim mapping processing object that generation module 80 generates, and second source object and second destination object are committed to interim mapping as parameter handle object, the mapping process of object handles second source object and second destination object is handled in interim mapping, namely based on the invokespecial of primary java bytecode, invokevirtual, invokeinterface, Get operation and the Set operation of attribute finished in instructions such as invokestatic.
When existing, client 20 need shine upon the new mapping object of processing, and the type of the mapping object that this is new with the first source object type and/or destination object type not simultaneously, first calling module 24 of client 20 calls mapping processor 40, finish the mapping processing procedure by mapping processor 40, and in processing procedure, record map operation result generates new interim mapping and handles object.
In this embodiment, by the execution result of logging modle 60 record mappings, generate interim mapping by generation module 80 according to the record result and handle object.When mapping ruler did not change, second calling module 26 of client 20 called interim mapping and handles object, handled object handles to the picture mapping by interim mapping.
Use the technical scheme that this embodiment provides, when finishing the mapping of a plurality of same type source objects, need not concrete analysis is carried out in each mapping, whole mapping process is through after certain operating analysis, can generate the interim object of handling by the compiling of dynamic byte sign indicating number, follow-up mapping all can directly be handled by interim processing object, thereby promotes the performance of mapping process.
Secondly, the mapping processor of the embodiment of the present application is described, wherein, the mapping processor 40 in the aforementioned object map disposal system can be any one mapping processor of hereinafter introducing.
Fig. 3 is the theory diagram according to the mapping processor of the embodiment of the present application, and as shown in Figure 3, this mapping processor comprises: receiver module 41, enquiry module 43, the first determination modules 45, acquisition module 47 and module 49 is set.
The enquiry module 43 inquiries mapping ruler corresponding with this source object type and destination object type, wherein, mapping ruler is by the client setting, particularly, client arranges order setting according to what receive, carry out the mapping ruler definition dynamically, support based on the definition of xml file configuration perhaps programmatic method definition.Client defines dissimilar mapping rulers according to the mapping business demand, and the mapping ruler that defines is stored in predetermined database.The main contents that mapping ruler comprises have:
Source attribute information: attribute-name, attribute type, attribute place class, the nested attribute type of aggregate attribute;
Target property information: attribute-name, attribute type, attribute place class, the nested attribute type of aggregate attribute.
The mapping ruler that first determination module 45 inquires according to enquiry module 43 is determined Get operation and Set operation.Particularly, determine the Get operation corresponding with the source attribute information in the mapping ruler, the Set corresponding with the target property information in mapping ruler operation, such as Pojo bean, aggregate type (map) and there is not attribution method, all can corresponding specific Get/Set operation.
Further, the Get/Set at this place operation can be self-defined, can expand, for example: the situation of heavy duty appears at the attribution method name, can self-defined Get/Set operation, and clearly select one of them method to carry out attribute and obtain; At no attribution method, can operate by self-defined Get/Set, by the Reflect mechanism that jdk provides, carry out attribute and obtain; At the mapping of many-one (perhaps one-to-many), can be self-defined the Get/Set operation, by recurrence call the mapping ruler storehouse, finish the mapping of the degree of depth.
In this embodiment, by the enquiry module 43 inquiries mapping ruler corresponding with mapping object, determine the Get operation corresponding with mapping ruler and Set operation by first determination module 45, operate the map operation of finishing the source object all properties by Get operation and the Set that determines, also namely finish source object to the mapping of destination object.
Use the technical scheme that this embodiment provides, the mapping ruler that mapping processor is finished mapping process to be needed can be the self-defining mapping ruler of client, makes this mapping processor system can support the mapping of dynamic attribute; The mapping ruler that the mapping processor inquiry is corresponding with mapping object, determine Get operation and Set operation according to the mapping ruler that inquires, mapping ruler is not simultaneously, adopt different Get operations and Set operation, make this mapping processor can support dissimilar object map, and the situation of using with of different object; In whole mapping process, attribute assignment between source object and the destination object does not rely on attribute-name, client is submitted to the destination object of mapping processor can be without any attribute data, makes this mapping processor can support the mapping between the different attribute name of source object and destination object.
For the dissimilar conversion that solves source object and destination object and the conversion of isomeric data, preferably, mapping ruler also comprises the plug-in unit Rule Information, and mapping processor also comprises: second determination module and data processing module.
Second determination module is used for determining the ValuePrcocess plug-in unit corresponding with the plug-in unit Rule Information, data processing module carries out data by the ValuePrcocess plug-in unit property value of determining that operation is obtained to Get to be handled, particularly, the Get operation passes to the ValuePrcocess plug-in unit with the property value that obtains as an ephemeral data object, the ValuePrcocess plug-in unit carries out data according to the plug-in unit Rule Information in the mapping ruler to be handled, and comprise that following any one or several data isomery handle: capital and small letter transforms, conversion in type, string formatization, add default value during for sky, data are carried out arithmetic and data carried out visit of EL expression language etc.After the ValuePrcocess plug-in unit carries out the data processing, just like that ephemeral data object continues to pass to the Set operation, the property value after data are handled in the Set operation is set on the destination object.
Adopt this preferred embodiment, in the mapping processing procedure, introduced the processing of ValuePrcocess plug-in unit, can support the conversion of isomeric data, can reserve corresponding expansion interface simultaneously, handle to solve isomeric data unknown in the subsequent treatment.
Corresponding with the embodiment of the application's mapping processor, the application also provides the embodiment of object map disposal route.
Fig. 4 is the process flow diagram according to the object map disposal route of the application first embodiment, and as shown in Figure 4, this method comprises that following step S102 is to step S110:
Step S102: receive source object and destination object that client is submitted to.
Also be the handling procedure of client call mapping, source object and the destination object of processing to be mapped are submitted to as parameter that the destination object of this moment is without any attribute data, this step can realize by the receiver module 41 in embodiment illustrated in fig. 3.
Step S104: inquire about the mapping ruler corresponding with source object type and destination object type.
Wherein, mapping ruler is by the client setting, and particularly, client arranges order setting according to what receive, carries out the mapping ruler definition dynamically, supports based on the definition of xml file configuration perhaps programmatic method definition.Client defines dissimilar mapping rulers according to the mapping business demand, and this step can realize by the enquiry module 43 in embodiment illustrated in fig. 3.The main contents that mapping ruler comprises have: the source attribute information: attribute-name, attribute type, attribute place class, the nested attribute type of aggregate attribute; Target property information: attribute-name, attribute type, attribute place class, the nested attribute type of aggregate attribute.
Step S106: determine the Get operation corresponding with the source attribute information, the Set operation corresponding with target property information.
Wherein, the Get operation that identical source attribute information is corresponding identical, the Set operation that identical target property information is corresponding identical, this step can realize by first determination module 45 in embodiment illustrated in fig. 3.
Step S108: obtain the property value of each attribute of source object by the Get operation of determining, this step can realize by the acquisition module 47 in embodiment illustrated in fig. 3.
Step S110: by the Set operation of determining property value is set on the destination object, this step can realize by the acquisition module 49 in embodiment illustrated in fig. 3.
Operate the map operation of finishing the source object all properties by Get operation and the Set that determines, also namely finish source object to the mapping of destination object.
In this embodiment, by the step S104 inquiry mapping ruler corresponding with mapping object, determine the Get operation corresponding with mapping ruler and Set operation by step S106, operate the map operation of finishing the source object all properties by step S108 and step S110 by Get operation and the Set that determines, also namely finish source object to the mapping of destination object.
Use the technical scheme that this embodiment provides, realize that the mapping ruler that object map needs can be the self-defining mapping ruler of client, make this object map disposal route can support the mapping of dynamic attribute; Mode according to inquiry, be condition with the mapping object type, inquire about the mapping ruler corresponding with mapping object, determine Get operation and Set operation according to the mapping ruler that inquires, mapping ruler is not simultaneously, adopt different Get operations and Set operation, make this object map disposal route can support dissimilar object map, and the situation of using with of different object; In whole mapping process, attribute assignment between source object and the destination object does not rely on attribute-name, the destination object that client is submitted to can be without any attribute data, makes this object map disposal route can support the mapping between the different attribute name of source object and destination object.
For the dissimilar conversion that solves source object and destination object and the conversion of isomeric data, preferably, this embodiment also provides second embodiment of object map disposal route, mapping ruler among this embodiment also comprises the plug-in unit Rule Information, Fig. 5 is the synoptic diagram according to the object map disposal route of the application second embodiment, as shown in Figure 5, receiving source object and destination object, inquire the mapping ruler corresponding with source object type and destination object type, determine the Get operation corresponding with this mapping ruler, after Set operation and ValueProcess handled plug-in unit, whole mapping process is abstract to be to operate by Get, three processes that Set operation and ValuePrcoess plug-in unit are finished.
First process: extracting relevant mapping (enum) data by the Get operation from source object, also is the property value of source object.Different object types is corresponding to different Get action types, such as the general data object, and Map (structure type of key-value) data object, structure data etc., corresponding different Get operations.
Second process: the ValueProcess plug-in unit is processed processing to mapping (enum) data, and wherein, this ValueProcess plug-in unit is corresponding with the plug-in unit Rule Information in the mapping ruler.It can be that the data isomery is handled that the processing of the data at this place is handled, and comprises following any one or multiple processing mode: capital and small letter conversion, conversion in type, string formatization, add the visit of default value, arithmetic and EL expression language when empty.
The 3rd process: the mapping (enum) data after by Set operation data being handled is set to destination object.Different object types is corresponding to different Set action types, such as the general data object, and Map (structure type of key-value) data object, structure data etc., corresponding different Set operations.
In this embodiment, the mapping of each object is conceptualized as the mapping between a plurality of attributes, the mapping of each attribute at first can be operated the result data that obtains under the source object by Get, this result data is handled plug-in unit by ValueProcess and is carried out data processing processing, data after the processing are passed through corresponding Set operation setting again to destination object, finish the mapping process of an attribute, the intact all best property of attribute mapping of circular treatment have just been finished whole object map process.
Adopt the object map disposal route of this embodiment, introduced the processing procedure of ValuePrcocess plug-in unit, make this object map disposal route can support the conversion of isomeric data, can reserve corresponding expansion interface simultaneously, handle to solve isomeric data unknown in the subsequent treatment.
In order to further describe second embodiment of object map disposal route, present specification provides the sequential chart of this method.Fig. 6 is the sequential chart according to the object map disposal route of the application second embodiment, and as shown in Figure 6, starting point is that client is carried out the mapping ruler definition dynamically in the sequential chart.After finishing definition, the client call mapping processor, and submit to corresponding source object and destination object as parameter, this moment, destination object was without any attribute data.The client at this place is the caller of mapping processor, and the invoke code of mapping program is client, and invoke code shines upon source object and the destination object of processing with needs, submits to mapping processor.Mapping processor finds corresponding mapping ruler according to this mapping object type, determine Get required in the whole mapping scheme, Set operation and ValuePrcocess plug-in unit according to this mapping ruler of process, source object is resolved to the map operation of a plurality of attributes to the mapping of destination object.
For each attribute, at first obtain the property value of corresponding source object by the Get operation, then the getattr value is passed to the ValueProcess plug-in unit as an ephemeral data object, call plug-in unit processing attribute value.The ValueProcess plug-in unit carries out corresponding rule treatments, and such as conversion in type, capital and small letter is handled, and string formatization etc. continue to pass to corresponding Set with the ephemeral data object after handling and operate.Property value after the Set operation will be handled is set on the destination object, has finished the map operation of an attribute.
After finishing the map operation of an attribute, handle the mapping of next attribute, after all attributes have all been finished dealing with, jump out mapping processor, and being back to the breakpoint place of mapping program invoke code, comprised corresponding mapping (enum) data in the target data object this moment.
With can only compare based on the mapping ruler of acquiescence in the object map disposal route of prior art, present embodiment had both supported to be similar to the mapping configuration of the acquiescence of prior art, simultaneously also allow to carry out Dynamic Definition, such as passing through XML, change mapping ruler when perhaps Java API code moves, with the definition of flexible way more mapping ruler, has following advantage based on the Dynamic Definition mapping ruler: can be based on transformable data object of when operation, allowing mapping ORM framework to carry out data handles, express submission object, document-type database result object etc. such as the Form in the html page; At the mapping of complex data object, the conversion that the ValueProcess plug-in unit carries out isomeric data can be set flexibly, perhaps can finish business processing by self-defined conversion plug-in unit.
In this embodiment, a kind of mapping ruler based on customizable is provided, can have expanded, object map scheme efficiently, particularly:
On the basis of when supporting operation, analyzing, also support by definition mapping rulers such as XML, API simultaneously, allow the mapping process between the non-attribute of the same name, allow the mapping relations of n:1 or 1:n;
At dynamic attribute mapping, the programming mode defined attribute mapping ruler in the time of can be based on operation;
Mapping process with attribute, abstract is the Get operation of extracting property value earlier from source object, and with the Set operation that the property value assignment is given destination object, can exist different Get, Set operation to realize selective, solve attribute scheme appearance heavy duty in the prior art, the problem of no attribution method;
Get operation and Set operation all can be expanded, and allow to support dissimilar objects, for example aggregate type, map type, specific character " this " etc.;
In the process of Get operation and Set operational processes, between Get operation and Set operated, abstract ValueProcess plug-in unit can carry out the conversion processing of isomeric data.
As seen through the above description of the embodiments, object map disposal route in the embodiment of the present application, mapping ruler can be self-defined by client, the mapping of finishing all properties by the extraction operation corresponding with mapping ruler and setting operation, attribute assignment does not rely on attribute-name itself, makes the application's the disposal route of object map can support the mapping between the different attribute name.
For the convenience of describing, be divided into various modules with function when describing above the device and describe respectively.Certainly, when implementing the application, can in same or a plurality of softwares and/or hardware, realize the function of each module.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the application and can realize by the mode that software adds essential general hardware platform.Based on such understanding, the part that the application's technical scheme contributes to prior art in essence in other words can embody with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the application or embodiment.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses is difference with other embodiment.Especially, for system embodiment, because it is substantially similar in appearance to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
The application can be used in numerous general or special purpose computingasystem environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, comprise distributed computing environment of above any system or equipment etc.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can in distributed computing environment, put into practice the application, in these distributed computing environment, be executed the task by the teleprocessing equipment that is connected by communication network.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
Though described the application by embodiment, those of ordinary skills know, the application has many distortion and variation and the spirit that do not break away from the application, wish that appended claim comprises these distortion and variation and the spirit that do not break away from the application.
Claims (10)
1. an object map disposal route is characterized in that, comprising:
Receive source object and destination object that client is submitted to;
Inquire about the mapping ruler corresponding with described source object type and described destination object type, wherein, described mapping ruler arranges order setting according to what described client received, and described mapping ruler comprises source attribute information and target property information;
Determine the extraction operation corresponding with described source attribute information, the setting operation corresponding with described target property information;
Obtain the property value of each attribute of described source object by the extraction operation of determining; And
By the setting operation of determining described property value is set on the described destination object.
2. object map disposal route according to claim 1 is characterized in that, described mapping ruler also comprises the plug-in unit Rule Information, and described method also comprises:
Determine the data processing plug-in unit corresponding with described plug-in unit Rule Information; And
The property value that described extraction operation is obtained by established data processing plug-in unit carries out the data processing,
Wherein, by the setting operation of determining the step that described property value is set on the described destination object is comprised: the property value after by described setting operation data being handled is set on the described destination object.
3. object map disposal route according to claim 2 is characterized in that, described data are handled and comprised that following any one or several data isomery handle:
Capital and small letter conversion, conversion in type, string formatization, add the visit of default value, arithmetic and EL expression language when being empty.
4. a mapping processor is characterized in that, comprising:
Receiver module is used for receiving source object and the destination object that client is submitted to;
Enquiry module is used for the inquiry mapping ruler corresponding with described source object type and described destination object type, and wherein, described mapping ruler is by described client setting, and described mapping ruler comprises source attribute information and target property information;
First determination module is used for determining the extraction operation corresponding with described source attribute information, the setting operation corresponding with described target property information;
Acquisition module is for the property value that obtains each attribute of described source object by the extraction operation of determining; And
Module is set, is used for by the setting operation of determining described property value being set to described destination object.
5. mapping processor according to claim 4 is characterized in that, described mapping ruler also comprises the plug-in unit Rule Information, and described mapping processor also comprises:
Second determination module is used for determining the data processing plug-in unit corresponding with described plug-in unit Rule Information; And
Data processing module is used for carrying out data by the property value that established data processing plug-in unit obtains described extraction operation and handles,
Wherein, the described module that arranges also is set to described destination object for the property value after by described setting operation data being handled.
6. mapping processor according to claim 4 is characterized in that, described data are handled and comprised that following any one or several data isomery handle:
Capital and small letter conversion, conversion in type, string formatization, the visit of adding default value when empty, data being carried out arithmetic and data carried out the EL expression language.
7. an object map disposal system is characterized in that, comprising: each described mapping processor in client and the claim 4 to 6, wherein,
Described client comprises:
Module is set, is used for according to the order that arranges that receives mapping ruler being set, wherein, described mapping ruler comprises source attribute information, target property information and plug-in unit Rule Information; And
First calling module is used for calling described mapping processor, and submits to first source object and first destination object to described mapping processor,
Described mapping processor is for the treatment of the mapping process of described first source object and described first destination object.
8. object map disposal system according to claim 7 is characterized in that, the described module that arranges comprises:
First arranges submodule, is used for based on the xml file configuration described mapping ruler being set according to the described order that arranges that receives; Or
Second arranges submodule, is used for based on programmatic method described mapping ruler being set according to the described order that arranges that receives.
9. object map disposal system according to claim 7 is characterized in that,
Described disposal system also comprises:
Logging modle is used for the result that the described mapping processor of record is handled described mapping process; And
Generation module is used for the result of described logging modle record is compiled, and handles object to generate interim mapping,
Described client also comprises: second calling module, be used for calling described interim mapping and handle object, and submit to second source object and second destination object to described interim mapping to handle object, wherein, the type of the type of described second source object and described second destination object is corresponding with described mapping ruler, and described interim mapping is handled object for the treatment of the mapping process of described second source object and described second destination object.
10. object map disposal system according to claim 9 is characterized in that, described generation module is used for generating described interim mapping by the compiling of dynamic byte sign indicating number and handles object.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012100558038A CN103294462A (en) | 2012-03-05 | 2012-03-05 | Object mapping processing method, mapping processor and object mapping processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012100558038A CN103294462A (en) | 2012-03-05 | 2012-03-05 | Object mapping processing method, mapping processor and object mapping processing system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103294462A true CN103294462A (en) | 2013-09-11 |
Family
ID=49095406
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012100558038A Pending CN103294462A (en) | 2012-03-05 | 2012-03-05 | Object mapping processing method, mapping processor and object mapping processing system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103294462A (en) |
Cited By (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461560A (en) * | 2014-12-23 | 2015-03-25 | 北京京东尚科信息技术有限公司 | Converting method of information type examples |
CN105138613A (en) * | 2015-08-07 | 2015-12-09 | 北京思特奇信息技术股份有限公司 | Business object and xml message mutual conversion method and system |
CN105224293A (en) * | 2014-05-30 | 2016-01-06 | 阿里巴巴集团控股有限公司 | The generation method of destination object and server |
CN105550263A (en) * | 2015-12-05 | 2016-05-04 | 百势软件(北京)有限公司 | Assignment method and device in object-relational mapping |
CN105843605A (en) * | 2016-03-17 | 2016-08-10 | 中国银行股份有限公司 | Data mapping data and device |
CN106095409A (en) * | 2016-05-31 | 2016-11-09 | 浪潮通用软件有限公司 | The device and method that a kind of data map |
CN106682036A (en) * | 2015-11-11 | 2017-05-17 | 上海汽车集团股份有限公司 | Data exchange system and exchange method thereof |
CN106708846A (en) * | 2015-11-12 | 2017-05-24 | 北京国双科技有限公司 | Collection method and device for webpage data |
CN108062379A (en) * | 2017-12-13 | 2018-05-22 | 北京天广汇通科技有限公司 | Data processing method, platform, device and computer readable storage medium |
CN108694045A (en) * | 2017-02-14 | 2018-10-23 | 北京国双科技有限公司 | A kind of data processing method and device |
CN109086037A (en) * | 2018-08-16 | 2018-12-25 | 北京中科梧桐网络科技有限公司 | A kind of Java Bean and the mutual conversion map model of Java Map |
CN109947418A (en) * | 2019-03-27 | 2019-06-28 | 厦门纳龙科技有限公司 | A kind of data model translation method and device |
CN110286883A (en) * | 2019-06-03 | 2019-09-27 | 中国建设银行股份有限公司 | Intelligence database encodes monitoring method, device and electronic equipment |
CN110533162A (en) * | 2019-07-25 | 2019-12-03 | 中国科学院计算技术研究所 | It is a kind of to automatically generate the method and system that mapping is operated between deep learning frame |
CN110995476A (en) * | 2019-11-20 | 2020-04-10 | 北京宝兰德软件股份有限公司 | Network equipment maintenance method based on SNMP |
CN111061743A (en) * | 2019-12-25 | 2020-04-24 | 北京百度网讯科技有限公司 | Data processing method and device and electronic equipment |
CN111124382A (en) * | 2019-12-17 | 2020-05-08 | 北京金山云网络技术有限公司 | Attribute assignment method and device in Java and server |
CN111913814A (en) * | 2020-07-09 | 2020-11-10 | 海南车智易通信息技术有限公司 | Object copying method and computing equipment |
CN112215566A (en) * | 2020-09-27 | 2021-01-12 | 东信和平科技股份有限公司 | Card making data processing method, system, equipment and storage medium of bank card |
CN112818044A (en) * | 2021-01-21 | 2021-05-18 | 西安交通大学 | Heterogeneous database mode mapping method, system, device and readable storage medium |
CN110019479B (en) * | 2017-12-28 | 2021-07-30 | 北京京东尚科信息技术有限公司 | Data operation detection method and device |
CN113326031A (en) * | 2021-05-28 | 2021-08-31 | 网易(杭州)网络有限公司 | Attribute acquisition method and device |
CN113553062A (en) * | 2021-07-23 | 2021-10-26 | 中国电子科技集团公司第二十八研究所 | State machine code generation method based on template technology |
CN113760241A (en) * | 2021-01-21 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Data processing method and device for mobile client |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1604082A (en) * | 2003-08-29 | 2005-04-06 | 微软公司 | Mapping architecture for arbitrary data models |
US20070203923A1 (en) * | 2006-02-28 | 2007-08-30 | Thomas Susan M | Schema mapping and data transformation on the basis of a conceptual model |
US20070299704A1 (en) * | 2006-06-26 | 2007-12-27 | Wildhagen Andreas U | Extending data flows |
-
2012
- 2012-03-05 CN CN2012100558038A patent/CN103294462A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1604082A (en) * | 2003-08-29 | 2005-04-06 | 微软公司 | Mapping architecture for arbitrary data models |
US20070203923A1 (en) * | 2006-02-28 | 2007-08-30 | Thomas Susan M | Schema mapping and data transformation on the basis of a conceptual model |
US20070299704A1 (en) * | 2006-06-26 | 2007-12-27 | Wildhagen Andreas U | Extending data flows |
Cited By (33)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105224293A (en) * | 2014-05-30 | 2016-01-06 | 阿里巴巴集团控股有限公司 | The generation method of destination object and server |
CN104461560B (en) * | 2014-12-23 | 2018-06-15 | 北京京东尚科信息技术有限公司 | A kind of conversion method of info class example |
CN104461560A (en) * | 2014-12-23 | 2015-03-25 | 北京京东尚科信息技术有限公司 | Converting method of information type examples |
CN105138613A (en) * | 2015-08-07 | 2015-12-09 | 北京思特奇信息技术股份有限公司 | Business object and xml message mutual conversion method and system |
CN106682036A (en) * | 2015-11-11 | 2017-05-17 | 上海汽车集团股份有限公司 | Data exchange system and exchange method thereof |
CN106708846B (en) * | 2015-11-12 | 2020-04-21 | 北京国双科技有限公司 | Method and device for collecting webpage data |
CN106708846A (en) * | 2015-11-12 | 2017-05-24 | 北京国双科技有限公司 | Collection method and device for webpage data |
CN105550263A (en) * | 2015-12-05 | 2016-05-04 | 百势软件(北京)有限公司 | Assignment method and device in object-relational mapping |
CN105843605A (en) * | 2016-03-17 | 2016-08-10 | 中国银行股份有限公司 | Data mapping data and device |
CN105843605B (en) * | 2016-03-17 | 2019-03-08 | 中国银行股份有限公司 | A kind of data mapping method and device |
CN106095409A (en) * | 2016-05-31 | 2016-11-09 | 浪潮通用软件有限公司 | The device and method that a kind of data map |
CN108694045A (en) * | 2017-02-14 | 2018-10-23 | 北京国双科技有限公司 | A kind of data processing method and device |
CN108062379A (en) * | 2017-12-13 | 2018-05-22 | 北京天广汇通科技有限公司 | Data processing method, platform, device and computer readable storage medium |
CN108062379B (en) * | 2017-12-13 | 2021-07-30 | 北京天广汇通科技有限公司 | Data processing method, platform, device and computer readable storage medium |
CN110019479B (en) * | 2017-12-28 | 2021-07-30 | 北京京东尚科信息技术有限公司 | Data operation detection method and device |
CN109086037A (en) * | 2018-08-16 | 2018-12-25 | 北京中科梧桐网络科技有限公司 | A kind of Java Bean and the mutual conversion map model of Java Map |
CN109947418A (en) * | 2019-03-27 | 2019-06-28 | 厦门纳龙科技有限公司 | A kind of data model translation method and device |
CN110286883A (en) * | 2019-06-03 | 2019-09-27 | 中国建设银行股份有限公司 | Intelligence database encodes monitoring method, device and electronic equipment |
CN110286883B (en) * | 2019-06-03 | 2024-01-30 | 中国建设银行股份有限公司 | Intelligent database coding monitoring method and device and electronic equipment |
CN110533162A (en) * | 2019-07-25 | 2019-12-03 | 中国科学院计算技术研究所 | It is a kind of to automatically generate the method and system that mapping is operated between deep learning frame |
CN110533162B (en) * | 2019-07-25 | 2022-01-07 | 中国科学院计算技术研究所 | Method and system for automatically generating operation mapping between deep learning frames |
CN110995476A (en) * | 2019-11-20 | 2020-04-10 | 北京宝兰德软件股份有限公司 | Network equipment maintenance method based on SNMP |
CN111124382A (en) * | 2019-12-17 | 2020-05-08 | 北京金山云网络技术有限公司 | Attribute assignment method and device in Java and server |
CN111061743B (en) * | 2019-12-25 | 2023-10-31 | 北京百度网讯科技有限公司 | Data processing method and device and electronic equipment |
CN111061743A (en) * | 2019-12-25 | 2020-04-24 | 北京百度网讯科技有限公司 | Data processing method and device and electronic equipment |
CN111913814A (en) * | 2020-07-09 | 2020-11-10 | 海南车智易通信息技术有限公司 | Object copying method and computing equipment |
CN111913814B (en) * | 2020-07-09 | 2024-05-31 | 海南车智易通信息技术有限公司 | Object copying method and computing device |
CN112215566A (en) * | 2020-09-27 | 2021-01-12 | 东信和平科技股份有限公司 | Card making data processing method, system, equipment and storage medium of bank card |
CN112818044A (en) * | 2021-01-21 | 2021-05-18 | 西安交通大学 | Heterogeneous database mode mapping method, system, device and readable storage medium |
CN113760241A (en) * | 2021-01-21 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Data processing method and device for mobile client |
CN113326031A (en) * | 2021-05-28 | 2021-08-31 | 网易(杭州)网络有限公司 | Attribute acquisition method and device |
CN113326031B (en) * | 2021-05-28 | 2023-08-22 | 网易(杭州)网络有限公司 | Attribute acquisition method and device |
CN113553062A (en) * | 2021-07-23 | 2021-10-26 | 中国电子科技集团公司第二十八研究所 | State machine code generation method based on template technology |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103294462A (en) | Object mapping processing method, mapping processor and object mapping processing system | |
US10346184B2 (en) | Open data protocol services in applications and interfaces across multiple platforms | |
US10339481B2 (en) | Systems and methods for generating user interface-based service workflows utilizing voice data | |
US20220043637A1 (en) | Providing communication between a client system and a process-based software application | |
CN109947994B (en) | Payment process processing method, device, medium and electronic equipment | |
US9098314B2 (en) | Systems and methods for web based application modeling and generation | |
US9043809B2 (en) | OData service provisioning on top of GenIL layer | |
CN108989384A (en) | A kind of method of data processing, cloudy management system and relevant device | |
US11797273B2 (en) | System and method for enhancing component based development models with auto-wiring | |
CN109871289B (en) | Remote Procedure Call (RPC) service generation method and device | |
JP2018014130A (en) | Business activity monitoring runtime | |
US8966442B2 (en) | Custom code innovation management | |
MXPA05002276A (en) | System and method for building wireless applications with intelligent mapping between user interface and data components . | |
US8336035B2 (en) | Customizable dynamic language expression interpreter | |
EP4113390A2 (en) | Method for processing data, and electronic device | |
CN110689268B (en) | Method and device for extracting indexes | |
US20110179397A1 (en) | Systems and methods for metamodel transformation | |
CA2538561C (en) | System and method for conversion of web services applications into component based applications for devices | |
CN101137957A (en) | Method and system for query generation in a task based dialog system | |
CN104361040A (en) | Method and device for customized query | |
CN112214236B (en) | Method for building management system of application architecture of software rapid development platform | |
CN113806429A (en) | Canvas type log analysis method based on large data stream processing framework | |
US10505873B2 (en) | Streamlining end-to-end flow of business-to-business integration processes | |
KR20200123624A (en) | Cloud-based application development platform | |
CN115803729A (en) | Direct data loading of middleware generated records |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 1184876 Country of ref document: HK |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20130911 |
|
REG | Reference to a national code |
Ref country code: HK Ref legal event code: WD Ref document number: 1184876 Country of ref document: HK |