CN102999575A - Method and system for configuring Hibernate mapping configuration file - Google Patents

Method and system for configuring Hibernate mapping configuration file Download PDF

Info

Publication number
CN102999575A
CN102999575A CN2012104526765A CN201210452676A CN102999575A CN 102999575 A CN102999575 A CN 102999575A CN 2012104526765 A CN2012104526765 A CN 2012104526765A CN 201210452676 A CN201210452676 A CN 201210452676A CN 102999575 A CN102999575 A CN 102999575A
Authority
CN
China
Prior art keywords
hibernate
map profile
module
configuration
map
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
Application number
CN2012104526765A
Other languages
Chinese (zh)
Other versions
CN102999575B (en
Inventor
张晓斌
侯君伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING GREATWE SCI-TECH DEVELOPMENT Co Ltd
Original Assignee
BEIJING GREATWE SCI-TECH DEVELOPMENT Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by BEIJING GREATWE SCI-TECH DEVELOPMENT Co Ltd filed Critical BEIJING GREATWE SCI-TECH DEVELOPMENT Co Ltd
Priority to CN201210452676.5A priority Critical patent/CN102999575B/en
Publication of CN102999575A publication Critical patent/CN102999575A/en
Application granted granted Critical
Publication of CN102999575B publication Critical patent/CN102999575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method for configuring a Hibernate mapping configuration file. The method comprises the following steps of creating configuration management files; classifying the Hibernate mapping configuration file; distributing each class of Hibernate mapping configuration files into the corresponding configuration management file, and selecting the configuration management file so as to load the Hibernate mapping configuration file in the selected configuration management file. According to the method for configuring the Hibernate mapping configuration file disclosed by the embodiment of the invention, the method has the advantages of being flexible to load the Hibernate mapping configuration file, convenient to manage, and low in maintenance cost; the resource occupied by the system can be effectively reduced, and a system for configuring the Hibernate mapping configuration file is also provided by the invention.

Description

A kind of collocation method of Hibernate Map Profile and system
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 the developer treat database with OO thought, has greatly simplified the complexity of operating database.The mapping relations of its business object and database are to realize by the Map Profile of Hibernate.But present configuration management mode mainly contains two kinds:
1, centralized configuration: all mapping relations that will manage of the configuration that in the SessionFactory of Hibernate, shows;
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 dual mode:
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 the entry situation; Catalogue is the way to manage of configuration automatically, automatically load all mapped files under the catalogue, cause the according to circumstances mapped file of concrete controlled loading of developer, load unnecessary mapped file and cause effectiveness of performance to descend, even might load conflict or wrong mapped file.
Summary of the invention
The present invention is intended to one of solve the problems of the technologies described above at least.
For this reason, one object of the present invention is to propose a kind of Hibernate Map Profile and loads flexibly, has the collocation method of the low Hibernate Map Profile of convenient management and maintenance cost.
Another object of the present invention is to propose a kind of configuration-system 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, may further comprise the steps: create the configuration management file; Described Hibernate Map Profile is classified; The Hibernate Map Profile of each class is assigned in the corresponding configuration management file; And the option and installment management document is in order to load Hibernate Map Profile in the selected configuration management file.
Collocation method according to the Hibernate Map Profile of the embodiment of the invention carries out classifying and dividing with the Hibernate Map Profile, for example by a plurality of configuration management files Hibernate configuration mapped file is configured.Convenient management and reduction maintenance cost can load the Hibernate Map Profile that exists in the different configuration management files on the other hand on the one hand, reduce heap(ed) capacity, thereby 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 characterictic:
The step of in some instances, described Hibernate Map Profile being classified comprises: according to the project development task described Hibernate Map Profile is classified; Perhaps according to the function of project described Hibernate Map Profile is classified.
In some instances, also comprise: create a plurality of catalogues according to classification results, and the Hibernate Map Profile of each class is assigned in the respective directories; Select catalogue in order to load Hibernate Map Profile in the selected catalogue.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in the same project.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in the disparity items.
The embodiment of second aspect present invention provides a kind of configuration-system of Hibernate Map Profile, comprising: configuration management document creation module is used for creating the configuration management file; Sort module is used for described Hibernate Map Profile is classified; The first distribution module is used for the Hibernate Map Profile of each class is assigned to corresponding configuration management file; The first load-on module is used for the option and installment management document in order to load the Hibernate Map Profile of selected configuration management file.
Configuration-system according to the Hibernate Map Profile of the embodiment of the invention carries out classifying and dividing with the Hibernate Map Profile, for example by a plurality of configuration management files Hibernate configuration mapped file is configured.Convenient management and reduction maintenance cost can load the Hibernate Map Profile that exists in the different configuration management files on the other hand on the one hand, reduce heap(ed) capacity, thereby 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 characterictic:
In some instances, described sort module is used for: according to the project development task described Hibernate Map Profile is classified; Perhaps according to the function of project described Hibernate Map Profile is classified.
In some instances, also comprise: the directory creating module is used for creating a plurality of catalogues according to classification results; The second distribution module is used for the Hibernate Map Profile of each class is assigned to respective directories; The second load-on module is used for selecting catalogue in order to load the Hibernate Map Profile of selected catalogue.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in the same project.
In some instances, described Hibernate Map Profile is from the Hibernate Map Profile in the disparity items.
Additional aspect of the present invention and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Description of drawings
Above-mentioned and/or additional aspect of the present invention and advantage are from obviously and easily understanding becoming the description of embodiment in conjunction with following accompanying drawing, 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 synoptic 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
The below describes embodiments of the invention in detail, and the example of described embodiment is shown in the drawings, and wherein identical or similar label represents identical or similar element or the element with identical or similar functions from start to finish.Be exemplary below by the embodiment that is described with reference to the drawings, only be used for explaining the present invention, and can not be interpreted as limitation of the present invention.
In description of the invention, it will be appreciated that, term " " center "; " vertically "; " laterally "; " on "; D score; " front ", " afterwards ", " left side ", " right side ", " vertically ", " level ", " top ", " end ", " interior ", orientation or the position relationship of indications such as " outward " are based on orientation shown in the drawings or position relationship, only be for convenience of description the present invention and simplified characterization, rather than device or the element of indication or hint indication must have specific orientation, with specific orientation structure and operation, therefore can not be interpreted as limitation of the present invention.In addition, term " first ", " second " only are used for describing purpose, and can not be interpreted as indication or hint relative importance.
In description of the invention, need to prove that unless clear and definite regulation and restriction are arranged in addition, term " installation ", " linking to each other ", " connection " should be done broad understanding, for example, can be to be fixedly connected with, also can be to removably connect, or connect integratedly; Can be mechanical connection, also can be to be electrically connected; Can be directly to link to each other, also can indirectly link to each other by intermediary, can be the connection of two element internals.For the ordinary skill in the art, can concrete condition understand above-mentioned term concrete meaning in the present invention.
Below in conjunction with collocation method and the system of accompanying drawing description according to the Hibernate Map Profile of the embodiment of the invention.
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 invention may further comprise the steps:
Step S101 creates the 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 the Hibernate Map Profile.
The step of particularly, the Hibernate Map Profile being classified comprises: according to task described Hibernate Map Profile is classified; Perhaps 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 Hibernate Map Profile of the required loading of task Y or a part of different, and task X and task Y only need load own needed Hibernate Map Profile and get final product, therefore, the needed Hibernate Map Profile of task X can be divided into a class, the needed Hibernate Map Profile of 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.Can the Hibernate Map Profile be classified based on module.
Step S103 is assigned to the Hibernate Map Profile of each class in the corresponding configuration management file.Thus, the developer can load the Hibernate Map Profile that is applicable to oneself according to module needs or task needs, as a concrete example, as shown in Figure 2, be the collocation method synoptic diagram of according to an embodiment of the invention Hibernate Map Profile.In this example, has the HigernateUtil class, such purposes is to accept a plurality of configuration management file (* .cfg.xml) by the mode of parameter or configuration file, from the configuration management file, read successively the Map Profile of Hibernate, and it is joined in the Configuration interface.After reading all configuration management files, create the SessionFactory of Hibernate by the Configuration class, thereby realize from different configuration management files, loading Hibernate Map Profile (map information).
Step S104, the option and installment management document is in order to load Hibernate Map Profile in the selected configuration management file.For example, as shown in Figure 2, the configuration management file comprises A.cfg.xml and 1.cfg.xml.Can want or finish the needed Hibernate Map Profile of same module and put into same configuration management file A.cfg.xml or 1.cfg.xml finishing same required by task, thereby load corresponding A.cfg.xml or 1.cfg.xml gets final product 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 gets final product by SessionFactory loading A.cfg.xml, and the developer B of task Y gets final product by SessionFactory loading 1.cfg.xml.Thus, same module only need load corresponding Hibernate Map Profile and get final product, reduce loading quantity, effectively improving the dirigibility that loads in the elevator system resource utilization, convenient management and maintenance cost are low, namely do not need to administer and maintain all Hibernate Map Profiles.In this example, the Hibernate Map Profile is from the Hibernate Map Profile in the same project, but embodiments of the invention are not limited to this, and for example, the Hibernate Map Profile can be from the Hibernate Map Profile in the disparity items.
In one embodiment of the invention, the collocation method of Hibernate Map Profile also can comprise the steps:
1, creates a plurality of catalogues according to classification results, and the Hibernate Map Profile of each class is assigned in the respective directories.The difference of this embodiment and above-described embodiment is that the configuration management file can replace by catalogue.
2, select catalogue in order to load Hibernate Map Profile in the selected catalogue.Load mode in its load mode and above-described embodiment is similar, in order to reduce redundancy, does not do and gives unnecessary details.
Collocation method according to the Hibernate Map Profile of the embodiment of the invention carries out classifying and dividing with the Hibernate Map Profile, for example by a plurality of configuration management files Hibernate configuration mapped file is configured.Convenient management and reduction maintenance cost can load the Hibernate Map Profile that exists in the different configuration management files on the other hand on the one hand, reduce heap(ed) capacity, thereby 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, the configuration-system 300 according to the Hibernate Map Profile of the embodiment of the invention comprises configuration management document creation module 310, sort module 320, the first distribution module 330 and the first load-on module 340.
Configuration management document creation module 310 is used for creating the 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 used for described Hibernate Map Profile is classified.Particularly, sort module 320 is used for according to task described Hibernate Map Profile being classified; Perhaps 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 Hibernate Map Profile of the required loading of task Y or a part of different, and task X and task Y only need load own needed Hibernate Map Profile and get final product, therefore, the needed Hibernate Map Profile of task X can be divided into a class, the needed Hibernate Map Profile of 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.Can the Hibernate Map Profile be classified based on module
The first distribution module 330 is used for the Hibernate Map Profile of each class is assigned to corresponding configuration management file.Thus, the developer can load the Hibernate Map Profile that is applicable to oneself according to module needs or task needs, as a concrete example, as shown in Figure 2, be the collocation method synoptic diagram of according to an embodiment of the invention Hibernate Map Profile.In this example, has the HigernateUtil class, such purposes is to accept a plurality of configuration management file (* .cfg.xml) by the mode of parameter or configuration file, from the configuration management file, read successively the Map Profile of Hibernate, and it is joined in the Configuration interface.After reading all configuration management files, create the SessionFactory of Hibernate by the Configuration class, thereby realize from different configuration management files, loading Hibernate Map Profile (map information).
The first load-on module 340 is used for the option and installment management document in order to load the Hibernate Map Profile of selected configuration management file.For example, as shown in Figure 2, the configuration management file comprises A.cfg.xml and 1.cfg.xml.Can want or finish the needed Hibernate Map Profile of same module and put into same configuration management file A.cfg.xml or 1.cfg.xml finishing same required by task, thereby load corresponding A.cfg.xml or 1.cfg.xml gets final product 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 gets final product by SessionFactory loading A.cfg.xml, and the developer B of task Y gets final product by SessionFactory loading 1.cfg.xml.Thus, same module only need load corresponding Hibernate Map Profile and get final product, reduce loading quantity, effectively improving the dirigibility that loads in the elevator system resource utilization, convenient management and maintenance cost are low, namely do not need to administer and maintain all Hibernate Map Profiles.In this example, the Hibernate Map Profile is from the Hibernate Map Profile in the same project, but embodiments of the invention are not limited to this, and for example, the Hibernate Map Profile can be from the Hibernate Map Profile in the 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, the directory creating module is used for creating a plurality of catalogues according to classification results.The second distribution module is used for the Hibernate Map Profile of each class is assigned to respective directories.The second load-on module is used for selecting catalogue in order to load the Hibernate Map Profile of selected catalogue.The difference of this embodiment and above-described embodiment is that the configuration management file can replace 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 do and gives unnecessary details.
Configuration-system according to the Hibernate Map Profile of the embodiment of the invention carries out classifying and dividing with the Hibernate Map Profile, for example by a plurality of configuration management files Hibernate configuration mapped file is configured.Convenient management and reduction maintenance cost can load the Hibernate Map Profile that exists in the different configuration management files on the other hand on the one hand, reduce heap(ed) capacity, thereby reduce Hibernate Map Profile occupying system resources, improve system performance.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or the example in conjunction with specific features, structure, material or the characteristics of this embodiment or example description.In this manual, the schematic statement of above-mentioned term not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or characteristics can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple variation, modification, replacement and modification to these embodiment in the situation that does not break away from principle of the present invention and aim, scope of the present invention is by claim and be equal to and limit.

Claims (10)

1. the collocation method of a Hibernate Map Profile is characterized in that, may further comprise the steps:
Create the configuration management file;
Described Hibernate Map Profile is classified;
The Hibernate Map Profile of each class is assigned in the corresponding configuration management file; And
The option and installment management document is in order to load Hibernate Map Profile in the selected configuration management file.
2. collocation method according to claim 1 is characterized in that, the step that described Hibernate Map Profile is classified comprises:
According to task described Hibernate Map Profile is classified; Perhaps
According to module described Hibernate Map Profile is classified.
3. collocation method according to claim 1 and 2 is characterized in that, also comprises:
Create a plurality of catalogues according to classification results, and the Hibernate Map Profile of each class is assigned in the respective directories;
Select catalogue in order to load Hibernate Map Profile in the selected catalogue.
4. collocation method according to claim 1 is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in the same project.
5. collocation method according to claim 1 is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in the disparity items.
6. the configuration-system of a Hibernate Map Profile is characterized in that, comprising:
Configuration management document creation module is used for creating the configuration management file;
Sort module is used for described Hibernate Map Profile is classified;
The first distribution module is used for the Hibernate Map Profile of each class is assigned to corresponding configuration management file;
The first load-on module is used for the option and installment management document in order to load the Hibernate Map Profile of selected configuration management file.
7. configuration-system according to claim 1 is characterized in that, described sort module is used for:
According to task described Hibernate Map Profile is classified; Perhaps
According to module described Hibernate Map Profile is classified.
8. according to claim 6 or 7 described configuration-systems, it is characterized in that, also comprise:
The directory creating module is used for creating a plurality of catalogues according to classification results;
The second distribution module is used for the Hibernate Map Profile of each class is assigned to respective directories;
The second load-on module is used for selecting catalogue in order to load the Hibernate Map Profile of selected catalogue.
9. configuration-system according to claim 6 is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in the same project.
10. configuration-system according to claim 6 is characterized in that, described Hibernate Map Profile is from the Hibernate Map Profile in the disparity items.
CN201210452676.5A 2012-11-12 2012-11-12 A kind of collocation method of Hibernate Map Profile and system Active CN102999575B (en)

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 true CN102999575A (en) 2013-03-27
CN102999575B CN102999575B (en) 2015-10-14

Family

ID=47928143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210452676.5A Active 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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
钟志丹: "web应用框架与文本分类技术应用研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 04, 12 March 2010 (2010-03-12) *

Also Published As

Publication number Publication date
CN102999575B (en) 2015-10-14

Similar Documents

Publication Publication Date Title
CN103425468B (en) Plug-in type software integrating method and device
US8863125B2 (en) Optimization of virtual appliance deployment
CN106933570A (en) Hair control software platform is surveyed in a kind of space flight based on plug-in part technology
CN102955675B (en) For improvement of method and the device of the resource utilization in data center
CN102934094B (en) Hierarchical allocation for file system storage device
US20150169313A1 (en) Integrated system and firmware update method
CN102831015B (en) The dispatching method of polycaryon processor and equipment
US9280370B2 (en) System structure management device, system structure management method, and program
US20200133657A1 (en) Method, electronic device and computer readable storage medium of storage management
CN103080903A (en) Scheduler, multi-core processor system, and scheduling method
CN105704188A (en) Deployment method and apparatus of applications and services
JPWO2012039053A1 (en) Computer system operation management method, computer system, and computer-readable medium storing program
CN101207633A (en) System and method for selecting function customization of network memory system
CN104054076B (en) Date storage method, database purchase node failure processing method and processing device
CN111857977B (en) Elastic expansion method, device, server and storage medium
CN104268022B (en) The resource allocation methods and system of process in a kind of operating system
CN102393848A (en) Method and system for acquiring identification information of data terminal equipment
CN101620515A (en) Method for enhancing logical volume management LVM function
CN103270520A (en) Importance class based data management
CN103684720B (en) A kind of system of selection of active and standby service unit and device
CN102323943A (en) Virtual-machine-based data storage method and system
CN105867935A (en) Application management method and device
CN102999575A (en) Method and system for configuring Hibernate mapping configuration file
CN103076971B (en) The process management method of mobile terminal and mobile terminal
CN103257970A (en) Method and device for testing primary node of HDFS (Hadoop Distributed File System)

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