CN102999575B - A kind of collocation method of Hibernate Map Profile and system - Google Patents
A kind of collocation method of Hibernate Map Profile and system Download PDFInfo
- Publication number
- CN102999575B CN102999575B CN201210452676.5A CN201210452676A CN102999575B CN 102999575 B CN102999575 B CN 102999575B CN 201210452676 A CN201210452676 A CN 201210452676A CN 102999575 B CN102999575 B CN 102999575B
- Authority
- CN
- China
- Prior art keywords
- hibernate
- map profile
- map
- module
- profile
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000012423 maintenance Methods 0.000 abstract description 9
- 230000008901 benefit Effects 0.000 abstract description 3
- 238000011161 development Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- VOZKAJLKRJDJLL-UHFFFAOYSA-N 2,4-diaminotoluene Chemical compound CC1=CC=C(N)C=C1N VOZKAJLKRJDJLL-UHFFFAOYSA-N 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 239000000463 material Substances 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The present invention proposes a kind of collocation method of Hibernate Map Profile, comprises the following steps: create configuration management file; Described Hibernate Map Profile is classified; The Hibernate Map Profile of each class is assigned in corresponding configuration management file; And option and installment management document is so that the Hibernate Map Profile in the configuration management file selected by loading.According to the collocation method of the Hibernate Map Profile of the embodiment of the present invention, there is Hibernate Map Profile and load flexibly, convenient management and maintenance cost is low, effectively can reduce the advantage that system takies resource.The invention allows for a kind of configuration-system of Hibernate Map Profile.
Description
Technical field
The present invention relates to field of computer technology, particularly a kind of collocation method of Hibernate Map Profile and system.
Background technology
Hibernate is the Open Framework of a data operation layer, and its ORMaping thought makes developer can treat database by OO thought, enormously simplify the complexity of operating database.The mapping relations of its business object and database are realized by the Map Profile of Hibernate.But current configuration management mode mainly contains two kinds:
1, centralized configuration: all mapping relations that will manage of the configuration shown in the SessionFactory of Hibernate;
2, catalogue configuration: specify a catalogue in the SessionFacotry of Hibernate, Hibernate loads the mapping relations under this catalogue automatically.
There is following shortcoming in above-mentioned two kinds of modes:
The way to manage of centralized displaying configuration, in the project of multiple person cooperational, can cause the management maintenance cost of this configuration file sharply to promote, this problem is more outstanding in entry situation; The way to manage that catalogue configures automatically, all mapped files under automatic loading catalogue, cause developer cannot the mapped file of according to circumstances concrete controlled loading, load unnecessary mapped file and cause effectiveness of performance to decline, be even likely loaded with and conflict or the mapped file of mistake.
Summary of the invention
The present invention is intended at least one of solve the problems of the technologies described above.
For this reason, one object of the present invention is to propose a kind of Hibernate Map Profile and loads flexibly, has convenient management and the collocation method of the low Hibernate Map Profile of maintenance cost.
Another object of the present invention is to the configuration-system proposing a kind of Hibernate Map Profile.
To achieve these goals, the embodiment of first aspect present invention provides a kind of collocation method of Hibernate Map Profile, comprises the following steps: create configuration management file; Described Hibernate Map Profile is classified; The Hibernate Map Profile of each class is assigned in corresponding configuration management file; And option and installment management document is so that the Hibernate Map Profile in the configuration management file selected by loading.
According to the collocation method of the Hibernate Map Profile of the embodiment of the present invention, Hibernate Map Profile is carried out classifying and dividing, such as, by multiple configuration management file, mapped file is configured to Hibernate and be configured.On the one hand convenient management and reduce maintenance cost, can load the Hibernate Map Profile existed in different configuration management file on the other hand, reduce heap(ed) capacity, thus reduce Hibernate Map Profile occupying system resources, improve system performance.
In addition, the collocation method of Hibernate Map Profile according to the above embodiment of the present invention can also have following additional technical characteristic:
In some instances, the step that described Hibernate Map Profile is classified is comprised: according to project development task, described Hibernate Map Profile is classified; Or the function according to project is classified to described Hibernate Map Profile.
In some instances, also comprise: create multiple catalogue according to classification results, and the Hibernate Map Profile of each class is assigned in respective directories; Select catalogue so that the Hibernate Map Profile in the catalogue selected by loading.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in same project.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in disparity items.
The embodiment of second aspect present invention provides a kind of configuration-system of Hibernate Map Profile, comprising: configuration management file creation module, for creating configuration management file; Sort module, for classifying to described Hibernate Map Profile; First distribution module, for being assigned in corresponding configuration management file by the Hibernate Map Profile of each class; First load-on module, for option and installment management document so that the Hibernate Map Profile in the configuration management file selected by loading.
According to the configuration-system of the Hibernate Map Profile of the embodiment of the present invention, Hibernate Map Profile is carried out classifying and dividing, such as, by multiple configuration management file, mapped file is configured to Hibernate and be configured.On the one hand convenient management and reduce maintenance cost, can load the Hibernate Map Profile existed in different configuration management file on the other hand, reduce heap(ed) capacity, thus reduce Hibernate Map Profile occupying system resources, improve system performance.
In addition, the configuration-system of Hibernate Map Profile according to the above embodiment of the present invention can also have following additional technical characteristic:
In some instances, described sort module is used for: classify to described Hibernate Map Profile according to project development task; Or the function according to project is classified to described Hibernate Map Profile.
In some instances, also comprise: directory creating module, for creating multiple catalogue according to classification results; Second distribution module, for being assigned in respective directories by the Hibernate Map Profile of each class; Second load-on module, for selecting catalogue so that the Hibernate Map Profile in the catalogue selected by loading.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in same project.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in disparity items.
Additional aspect of the present invention and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by practice of the present invention.
Accompanying drawing explanation
Above-mentioned and/or additional aspect of the present invention and advantage will become obvious and easy understand from accompanying drawing below combining to the description of embodiment, wherein:
Fig. 1 is the process flow diagram of the collocation method of Hibernate Map Profile according to an embodiment of the invention;
Fig. 2 is the schematic diagram of the collocation method of Hibernate Map Profile according to an embodiment of the invention; And
Fig. 3 is the structural drawing of the configuration-system of Hibernate Map Profile according to an embodiment of the invention.
Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.
In describing the invention, it will be appreciated that, term " " center ", " longitudinal direction ", " transverse direction ", " on ", D score, " front ", " afterwards ", " left side ", " right side ", " vertically ", " level ", " top ", " end ", " interior ", orientation or the position relationship of the instruction such as " outward " are based on orientation shown in the drawings or position relationship, only the present invention for convenience of description and simplified characterization, instead of indicate or imply that the device of indication or element must have specific orientation, with specific azimuth configuration and operation, therefore limitation of the present invention can not be interpreted as.In addition, term " first ", " second " only for describing object, and can not be interpreted as instruction or hint relative importance.
In describing the invention, it should be noted that, unless otherwise clearly defined and limited, term " installation ", " being connected ", " connection " should be interpreted broadly, and such as, can be fixedly connected with, also can be removably connect, or connect integratedly; Can be mechanical connection, also can be electrical connection; Can be directly be connected, also indirectly can be connected by intermediary, can be the connection of two element internals.For the ordinary skill in the art, concrete condition above-mentioned term concrete meaning in the present invention can be understood.
Below in conjunction with accompanying drawing description according to the collocation method of the Hibernate Map Profile of the embodiment of the present invention and system.
Fig. 1 is the process flow diagram of the collocation method of Hibernate Map Profile according to an embodiment of the invention.
As shown in Figure 1, the collocation method of the Hibernate Map Profile of the embodiment of the present invention, comprises the following steps:
Step S101, creates configuration management file.Can create the configuration management file of any amount, in one embodiment of the invention, the file type of this configuration management file is but is not limited to: the file of * .cfg.xml type.
Step S102, classifies to Hibernate Map Profile.
Particularly, the step that Hibernate Map Profile is classified is comprised: according to task, described Hibernate Map Profile is classified; Or according to module, described Hibernate Map Profile is classified.Specifically, task refers to development task, suppose in a development project, developer A is assigned to task X, developer B is assigned to task Y, be understandable that, task X is different with the required Hibernate Map Profile loaded of task Y or a part of different, and task X and task Y only need load the Hibernate Map Profile required for oneself, therefore, Hibernate Map Profile required for task X can be divided into a class, the Hibernate Map Profile required for task Y is divided into a class.Similarly, namely in a development project, there is the functional module of difference in functionality in the module number that a module project has.Based on module, Hibernate Map Profile can be classified.
Step S103, is assigned to the Hibernate Map Profile of each class in corresponding configuration management file.Thus, developer can need according to module or task needs to load the Hibernate Map Profile being applicable to oneself, as a concrete example, as shown in Figure 2, be the collocation method schematic diagram of Hibernate Map Profile according to an embodiment of the invention.In this example, there is HigernateUtil class, such purposes accepts multiple configuration management files (* .cfg.xml) by the mode of parameter or configuration file, from configuration management file, read the Map Profile of Hibernate successively, and joined in Configuration interface.After reading all configuration management files, created the SessionFactory of Hibernate by Configuration class, thus realize loading Hibernate Map Profile (map information) from different configuration management files.
Step S104, option and installment management document is so that the Hibernate Map Profile in the configuration management file selected by loading.Such as, as shown in Figure 2, configuration management file comprises A.cfg.xml and 1.cfg.xml.Can to want completing same required by task or the Hibernate Map Profile completed required for same module puts into same configuration management file A.cfg.xml or 1.cfg.xml, thus loading corresponding A.cfg.xml or 1.cfg.xml by SessionFactory.As shown in Figure 2, suppose that the Hibernate Map Profile that task X needs comprises: A1.cfg.xml and A2.cfg.xml, and the Hibernate Map Profile that task Y needs comprises: 11.cfg.xml and 12.cfg.xml, then the developer A of task X loads A.cfg.xml by SessionFactory, and the developer B of task Y loads 1.cfg.xml by SessionFactory.Thus, same module only need load corresponding Hibernate Map Profile, the dirigibility loaded is improved while reducing loading quantity, effectively elevator system resource utilization, convenient management and maintenance cost is low, does not namely need to administer and maintain all Hibernate Map Profiles.In this example, Hibernate Map Profile is from the Hibernate Map Profile in same project, but embodiments of the invention are not limited to this, such as, Hibernate Map Profile can from the Hibernate Map Profile in disparity items.
In one embodiment of the invention, the collocation method of Hibernate Map Profile also can comprise the steps:
1, create multiple catalogue according to classification results, and the Hibernate Map Profile of each class is assigned in respective directories.The difference of this embodiment and above-described embodiment is that configuration management file replaces by catalogue.
2, catalogue is selected so that the Hibernate Map Profile in the catalogue selected by loading.Load mode in its load mode and above-described embodiment is similar, in order to reduce redundancy, does not repeat.
According to the collocation method of the Hibernate Map Profile of the embodiment of the present invention, Hibernate Map Profile is carried out classifying and dividing, such as, by multiple configuration management file, mapped file is configured to Hibernate and be configured.On the one hand convenient management and reduce maintenance cost, can load the Hibernate Map Profile existed in different configuration management file on the other hand, reduce heap(ed) capacity, thus reduce Hibernate Map Profile occupying system resources, improve system performance.
Fig. 3 is the structural drawing of the configuration-system of Hibernate Map Profile according to an embodiment of the invention.
As shown in Figure 3, according to the configuration-system 300 of the Hibernate Map Profile of the embodiment of the present invention, comprise configuration management file creation module 310, sort module 320, first distribution module 330 and the first load-on module 340.
Configuration management file creation module 310 is for creating configuration management file.Can create the configuration management file of any amount, in one embodiment of the invention, the file type of this configuration management file is but is not limited to: the file of * .cfg.xml type.
Sort module 320 is for classifying to described Hibernate Map Profile.Particularly, sort module 320 is for classifying to described Hibernate Map Profile according to task; Or according to module, described Hibernate Map Profile is classified.Specifically, task refers to development task, suppose in a development project, developer A is assigned to task X, developer B is assigned to task Y, be understandable that, task X is different with the required Hibernate Map Profile loaded of task Y or a part of different, and task X and task Y only need load the Hibernate Map Profile required for oneself, therefore, Hibernate Map Profile required for task X can be divided into a class, the Hibernate Map Profile required for task Y is divided into a class.Similarly, namely in a development project, there is the functional module of difference in functionality in the module number that a module project has.Based on module, Hibernate Map Profile can be classified
First distribution module 330 is for being assigned to the Hibernate Map Profile of each class in corresponding configuration management file.Thus, developer can need according to module or task needs to load the Hibernate Map Profile being applicable to oneself, as a concrete example, as shown in Figure 2, be the collocation method schematic diagram of Hibernate Map Profile according to an embodiment of the invention.In this example, there is HigernateUtil class, such purposes accepts multiple configuration management files (* .cfg.xml) by the mode of parameter or configuration file, from configuration management file, read the Map Profile of Hibernate successively, and joined in Configuration interface.After reading all configuration management files, created the SessionFactory of Hibernate by Configuration class, thus realize loading Hibernate Map Profile (map information) from different configuration management files.
First load-on module 340 for option and installment management document in case load selected by configuration management file in Hibernate Map Profile.Such as, as shown in Figure 2, configuration management file comprises A.cfg.xml and 1.cfg.xml.Can to want completing same required by task or the Hibernate Map Profile completed required for same module puts into same configuration management file A.cfg.xml or 1.cfg.xml, thus loading corresponding A.cfg.xml or 1.cfg.xml by SessionFactory.As shown in Figure 2, suppose that the Hibernate Map Profile that task X needs comprises: A1.cfg.xml and A2.cfg.xml, and the Hibernate Map Profile that task Y needs comprises: 11.cfg.xml and 12.cfg.xml, then the developer A of task X loads A.cfg.xml by SessionFactory, and the developer B of task Y loads 1.cfg.xml by SessionFactory.Thus, same module only need load corresponding Hibernate Map Profile, the dirigibility loaded is improved while reducing loading quantity, effectively elevator system resource utilization, convenient management and maintenance cost is low, does not namely need to administer and maintain all Hibernate Map Profiles.In this example, Hibernate Map Profile is from the Hibernate Map Profile in same project, but embodiments of the invention are not limited to this, such as, Hibernate Map Profile can from the Hibernate Map Profile in disparity items.
In one embodiment of the invention, the configuration-system 300 of Hibernate Map Profile also can comprise directory creating module, the second distribution module and the second load-on module (not shown).
Particularly, directory creating module is used for creating multiple catalogue according to classification results.Second distribution module is used for the Hibernate Map Profile of each class to be assigned in respective directories.Second load-on module for selecting catalogue in case load selected by catalogue in Hibernate Map Profile.The difference of this embodiment and above-described embodiment is that configuration management file replaces by catalogue, and in addition, the load mode in its load mode and above-described embodiment is similar, in order to reduce redundancy, does not repeat.
According to the configuration-system of the Hibernate Map Profile of the embodiment of the present invention, Hibernate Map Profile is carried out classifying and dividing, such as, by multiple configuration management file, mapped file is configured to Hibernate and be configured.On the one hand convenient management and reduce maintenance cost, can load the Hibernate Map Profile existed in different configuration management file on the other hand, reduce heap(ed) capacity, thus reduce Hibernate Map Profile occupying system resources, improve system performance.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple change, amendment, replacement and modification to these embodiments when not departing from principle of the present invention and aim, scope of the present invention is by claim and equivalency thereof.
Claims (8)
1. a collocation method for Hibernate Map Profile, is characterized in that, comprises the following steps:
Create configuration management file;
Described Hibernate Map Profile is classified;
The Hibernate Map Profile of each class is assigned in corresponding configuration management file, option and installment management document is so that the Hibernate Map Profile in the configuration management file selected by loading, multiple catalogue is created according to classification results, the Hibernate Map Profile of each class is assigned in respective directories, and selects catalogue so that the Hibernate Map Profile in the catalogue selected by loading.
2. collocation method according to claim 1, is characterized in that, comprises the step that described Hibernate Map Profile is classified:
According to task, described Hibernate Map Profile is classified; Or
According to module, described Hibernate Map Profile is classified.
3. collocation method according to claim 1, is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in same project.
4. collocation method according to claim 1, is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in disparity items.
5. a configuration-system for Hibernate Map Profile, is characterized in that, comprising:
Configuration management file creation module, for creating configuration management file;
Sort module, for classifying to described Hibernate Map Profile;
First distribution module, for being assigned in corresponding configuration management file by the Hibernate Map Profile of each class;
First load-on module, for option and installment management document so that the Hibernate Map Profile in the configuration management file selected by loading;
Directory creating module, for creating multiple catalogue according to classification results;
Second distribution module, for being assigned in respective directories by the Hibernate Map Profile of each class;
Second load-on module, for selecting catalogue so that the Hibernate Map Profile in the catalogue selected by loading.
6. configuration-system according to claim 5, is characterized in that, described sort module is used for:
According to task, described Hibernate Map Profile is classified; Or
According to module, described Hibernate Map Profile is classified.
7. configuration-system according to claim 5, is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in same project.
8. configuration-system according to claim 5, is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in disparity items.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210452676.5A CN102999575B (en) | 2012-11-12 | 2012-11-12 | A kind of collocation method of Hibernate Map Profile and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210452676.5A CN102999575B (en) | 2012-11-12 | 2012-11-12 | A kind of collocation method of Hibernate Map Profile and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102999575A CN102999575A (en) | 2013-03-27 |
CN102999575B true CN102999575B (en) | 2015-10-14 |
Family
ID=47928143
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210452676.5A Expired - Fee Related CN102999575B (en) | 2012-11-12 | 2012-11-12 | A kind of collocation method of Hibernate Map Profile and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102999575B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101046810A (en) * | 2006-05-26 | 2007-10-03 | 华为技术有限公司 | System for automatic setting relation model and its method |
CN101290625A (en) * | 2008-06-11 | 2008-10-22 | 华东师范大学 | XML document storage and search method |
CN101980207A (en) * | 2010-11-09 | 2011-02-23 | 中国电信股份有限公司 | Method and system for implementing database access |
CN102004741A (en) * | 2009-09-01 | 2011-04-06 | 上海杉达学院 | Database access system |
CN102722372A (en) * | 2012-05-25 | 2012-10-10 | 上海学智科技有限公司 | Method and system for automatically generating codes through classification and configuration |
-
2012
- 2012-11-12 CN CN201210452676.5A patent/CN102999575B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101046810A (en) * | 2006-05-26 | 2007-10-03 | 华为技术有限公司 | System for automatic setting relation model and its method |
CN101290625A (en) * | 2008-06-11 | 2008-10-22 | 华东师范大学 | XML document storage and search method |
CN102004741A (en) * | 2009-09-01 | 2011-04-06 | 上海杉达学院 | Database access system |
CN101980207A (en) * | 2010-11-09 | 2011-02-23 | 中国电信股份有限公司 | Method and system for implementing database access |
CN102722372A (en) * | 2012-05-25 | 2012-10-10 | 上海学智科技有限公司 | Method and system for automatically generating codes through classification and configuration |
Non-Patent Citations (1)
Title |
---|
web应用框架与文本分类技术应用研究;钟志丹;《中国优秀硕士学位论文全文数据库 信息科技辑》;20100312(第04期);I138-1435 * |
Also Published As
Publication number | Publication date |
---|---|
CN102999575A (en) | 2013-03-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103425468B (en) | Plug-in type software integrating method and device | |
US8677317B2 (en) | Simplified deployment modeling | |
Hallerbach et al. | Configuration and management of process variants | |
CN102934094B (en) | Hierarchical allocation for file system storage device | |
US20150169313A1 (en) | Integrated system and firmware update method | |
US20130014111A1 (en) | Optimization of Virtual Appliance Deployment | |
CN105704188A (en) | Deployment method and apparatus of applications and services | |
CN106933570A (en) | Hair control software platform is surveyed in a kind of space flight based on plug-in part technology | |
CN103955364A (en) | Front end assembly method suitable for mobile phone | |
CN105468717A (en) | Database operation method and device | |
CN102609218B (en) | Method for implementing parallel-flash translation layer and parallel-flash translation layer system | |
CN104268022B (en) | The resource allocation methods and system of process in a kind of operating system | |
CN101207633A (en) | System and method for selecting function customization of network memory system | |
CN104781793A (en) | Systems and methods for integrating storage usage information | |
CN105677445A (en) | Application installation managing method, device and intelligent terminal | |
CN106095493A (en) | The loading method of dual operating systems and system | |
CN109885642A (en) | Classification storage method and device towards full-text search | |
CN102722368A (en) | Plug-in software designing method based on document tree and message pump | |
CN104700187A (en) | Bill generation method | |
CN102999575B (en) | A kind of collocation method of Hibernate Map Profile and system | |
CN103809947B (en) | A kind of method for automatically releasing of development requirement and system | |
CN109213504A (en) | A kind of stackable file system and its loading method and upgrade method | |
CN103257970B (en) | Method of testing and device for HDFS host node | |
CN105630530A (en) | Multilevel boot method and system of digital signal processor | |
CN102200918A (en) | Method and device for deploying application program in server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20151014 |
|
CF01 | Termination of patent right due to non-payment of annual fee |