Important alert: (current site time 5/20/2013 8:29:09 AM EDT)
 

Third Party Product Review:
Reviews are a new feature of Planet Source Code that allow site visitors to share their experiences on commercial third party products in real life situations.

article

Devart

Email
Submitted on: 9/28/2012 5:10:18 PM
By: Devart  
Level: Intermediate
User Rating: Unrated
Compatibility: C++.NET
Views: 931
author picture
(About the author)
 
     This review bring a closer look at NHibernate Mapping Samples application from Devart, which demonstrates 50 different mapping cases and how they are mapped using both fluent and XML mapping.


 
 
Terms of Agreement:   
By using this review, you agree to the following terms...   
  1. You may use any of the code in this review in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this review (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this review from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the review or review's description.
				NHibernate Mapping Samples application does not require any third-party software except for the .NET Framework. Simply launch the application and explore the NHibernate mapping samples. You can study the classes and mapping in the application window or open a Visual Studio project for each sample to check how it works in a real application. Database creation script is available for each sample. You can also easily access NHibernate documentation page relevant to the opened sample. If you have Entity Developer, you may also open Entity Developer models that were used for generating mapping and classes for samples.

The window of the NHibernate Mapping Samples application consists of four parts.
  • 1.The Samples tree lists all the available mapping cases.
  • 2.The Mapping box contains the sample of mapping for the selected mapping case. It has two tabs - XML and Fluent, containing the corresponding mapping code.
  • 3.The Code box contains the code of the classes, that are mapped.
  • 4.The Description box contains the short description of the selected mapping case and links that allow you to open the sample in Visual Studio, open model in Entity Developer, view the database script for this sample, or open the corresponding page in NHibernate documentation.

  • Here are some tips on how to work with our NHibernate Mapping Samples application (see the screenshot added):
  • To open a sample, click the corresponding node in the Samples tree (1).
  • To open the sample project in Visual Studio, click the "Open the sample in Visual Studio" link in the Description box (4).
  • To open the sample model in Entity Developer, click the "Open Entity Developer model" link in the Description box (4). You will be proposed to download the Trial Edition of Entity Developer if you do not have Entity Developer installed.
  • To view database objects creation script, click the "View database objects creation script" link in the Description box (4).
  • To open the corresponding page in NHibernate documentation, click the "view relevant NHibernate help topic" link in the Description box (4).
  • Mapping is displayed in the Mapping box (2). Note that you can switch between the fluent and XML mapping by selecting the corresponding tabs.
List of the Samples Class Mapping
  • Simple Class (tags used: , , )
  • Computed Property (formula attribute of the tag)
  • Version Property(tags used: )
  • Enum Type Property (type attribute of the tag)
  • Join Tables (tags used: )
  • where (where attribute of the tag)
  • filter (tags used: , , )
Class Identifier
  • Simple Identifier (tags used: )
  • Composite Identifier (tags used: )
  • Associations
    • One-to-Many(Collection mappings)
    • Simple One-to-Many (tags used: , , , )
    • Simple ZeroOrOne-to-Many (tags used: , , )
    • Unique Key (tags used: , , ; property-ref attribute of the tag)
    • Composite Identifier (tags used: , , )
    • Component Identifier (tags used: , , class attribute of the tag)
    • Component Unique Key (tags used: , , , property-ref attribute of the tag)
    • Join Tables (tags used: )
    • Order By (order-by attribute of the tag, , , , )
    • Where (where attribute of the tag, , , , )
    • Filter (tags used: , , )
    • Collection Of Components (tags used: )
    • Collection Types Set (tags used: ) Bag (tags used: ) Map (tags used: , ) Map With Complex Index (tags used , ) List (tags used: , ) Array (tags used , )
    One-To-One
    • Simple One-to-One (tags used: )
    • Component Identifier (tags used: , )
    • Unique Foreign Key (property-ref attribute of the tag и tags used: )
    • Composite Unique Foreign Key (tags used: ; property-ref attribute of the ; )
    Many-to-Many
    • Simple Many-to-Many (tags used: )
    • Composite Identifier (tags used: , )
    • Unique Keys (property-ref attribute of the tag; property-ref attribute of the tag)
    • Component Unique Keys (tags used: ; property-ref attribute of the tag; property-ref attribute of the tag)
    • Extra Columns Component (tags used: , )
    • Entity Index Map (tags used: , , )
    • IdBag Collection (tags used: , , )
    Components
    • Component Properties (tags used: , )
    • Embeded Components (tags used , )
    • Composite Identifier (tags used: )
    • Navigation properties: - Many-to-one (tags used: , ) - Many-to-many (tags used: , )
    Inheritances
    • Table Per Hierarchy (tags used: , )
    • Table Per Type (tags used: )
    • Table Per Concrete Class (tags used: )
    Named SQL Query
    • Without Result (tags used: , )
    • Scalar Result (tags used: , )
    • Entity Result (tags used: , , , )
    • Complex Type Result (tags used: , , , )
    • Execute Stored Function (tags used: and its attribute callable; )
    The code and mapping of these samples was generated by Entity Developer for NHibernate. Entity Developer for NHibernate, being the best NHibernate designer to-date, allows you to create NHibernate models fastly in a convenient GUI environment and generate code and mapping for them. Each of the samples is a complete separate Visual Studio project that demonstrates the implementation and usage of the mapping. You can open them in Visual Studio and study how they work. You can build and debug them to study how they work on the run, view results they return, or even modify them to study how to apply such mapping case in your projects. SQLite is used as a database for the samples, and dotConnect for SQLite is used to access the database. You don't need to install any additional software, the samples contains all the necessary files to be compiled and run. However you may download the trial edition of Entity Developer to view or edit mapping visually.


    Report Bad Submission
    Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
    This submission should be removed because:

    Your Vote

    What do you think of this review (in the Intermediate category)?
    (The review with your highest vote will win this month's coding contest!)
    Excellent  Good  Average  Below Average  Poor (See voting log ...)
     

    Other User Comments

     There are no comments on this submission.
     

    Add Your Feedback
    Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular review, please click here instead.)
     

    To post feedback, first please login.