Automatically generate an instance of the nhib.pdf configuration file Tool

Source: Internet
Author: User

Automatically generate an instance of the nhib.pdf configuration file Tool


Ladies and gentlemen, many of my friends recently studied nhib.pdf have asked me how to use the tool that automatically generates the nhib.pdf configuration file.CodeFor more information, see.
Notes:
1. The configuration file I generated here is similar to the database field, so there is no complicated configuration page. After the configuration file is generated, you can modify it based on your own situation.
2. since the tool was implemented at nhibernate0.3 and there was no time to update it later, some features may be enhanced or modified in the current Nhibernate, however, I have been using the method for generating configuration, and it is okay in version 0.7. It can be used.
3. since nullabletype does not exist at the beginning of my project, the datetime type is used to determine whether it is less than 1753. If someone else uses nullabletype, modify it by yourself, if you want to retain datetime, I have modified the datetime part in nhib.pdf. Please modify it by yourself.
4. When no attribute is set, this tool considers each attribute as a common attribute. Therefore, set one-to-one, one-to-one, and other attributes.

Using system;
Using system. collections;
Using hr;
Using manhour;
Using HR. employee;
Using nhibernateattribute;
Using market;
Using contract;
Using common;
Using nhib.pdf;
Using HR. organizationunit;

Namespace Project
{
[Nhibernateclass]
Public class cproject: Common. cobject
{
/// ID attribute
[Nhibernateid]
Public guid guidproject
{
Get
{
Return this. mguidproject;
}
Set
{
This. mguidproject = value;
}
}
/// Common attributes
Public string name
{
Get
{
Return this. mname;
}
Set
{
This. mname = value;
}
}
[Nhibernateonetotify ("contract. ccontract", "marketmanage", keycolumn = "guidassigntoproject")]
Public ilist contracts
{
Get
{
Return this. mcontracts;
}
Set
{
This. mcontracts = value;
}
}

[Nhibernatemanytoone]
Public cmanhour custmerrebackmanhour
{
Get
{
Return mcustmerrebackmanhour;
}
Set
{
Mcustmerrebackmanhour = value;
}
}

[nhibernateonetoone]
Public cemployee PM
{< br> Get
{< br> return MPM;
}< br> set
{< br> MPM = value;
}< BR >}< br> [nhibernatemanyto.pdf ("contract. ccontract, contract "," guidrole ")]
Public ilist contracts
{< br> Get
{< br> If (this. mcontracts = NULL)
This. mcontracts = new arraylist ();
return this. mcontracts;
}< br> set
{< br> This. mcontracts = value;
}< BR >}

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.