Use the powerdesigner 15 Object Oriented Model to generate the nhibernate Object class, ing

Source: Internet
Author: User
Tags powerdesigner

Previously, we used to generate database tables through the powerdesigner Object Oriented Model, and then generate the nhibernate Object class and ing files through the code generator. It is not very straightforward.

With the built-in functions of powerdesigner 15, you can generate the data access layer of nhib.pdf. However, it is not very good to use it in the actual environment by default. You can change the template to generate what you need. The following are the actual steps.

Create an object oriented model and select c #2.0 and nhibted.
 

 

 

 

Change the model properties and change the nhibernate settings.
 

 


 

 

 

 

Add property to the class and set an id
 

 

 

You can add Configuration File Settings here.

 

Design class diagram

 

 

The most critical step is to set the mapping editor and set it in the tool menu. Otherwise, the nhibernate file and data access layer cannot be generated.
 

 

 

 

 

 


You can see the preview code. Use generation c #2 code in the language menu to generate a physical file. It is best for a physical database to be generated by converting the object oriented model.
 

 

 

You can set the vs version to generate the nhibernate code, including vs2005 and vs2008.

Similar to the extension model, you can also generate the ado.net data access layer and unit test.

Select the data access layer based on hibernate or ejb3 that can be generated by using the java language.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.