Click here to Skip to main content
15,885,925 members
Articles / Database Development / SQL Server

Optimizing Performance in NHibernate: Part 2: A Collection of Enhancements

Rate me:
Please Sign up or sign in to vote.
4.86/5 (24 votes)
9 May 2007CPOL19 min read 199.1K   810   110  
This is the second part in a two-piece article focused on optimizing the efficiency of your NHibernate ORM layer.
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
	<class name="Northwind.Domain.Entities.OrderDetail, Northwind.Domain" table="[Order Details]">
    <composite-id>
      <key-many-to-one name="Order" class="Northwind.Domain.Entities.Order, Northwind.Domain" column="OrderID" />
      <key-many-to-one name="Product" class="Northwind.Domain.Entities.Product, Northwind.Domain" column="ProductID" />
    </composite-id>
		<property name="UnitPrice" type="Decimal">
			<column name="UnitPrice" sql-type="money" not-null="true"/>
		</property>
		<property name="Quantity" type="Int16">
			<column name="Quantity" sql-type="smallint" not-null="true"/>
		</property>
		<property name="Discount" type="Decimal">
			<column name="Discount" sql-type="real" not-null="true"/>
		</property>
	</class>
</hibernate-mapping>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Independent contract developer for .NET data-oriented systems.

not much to say about myself but feel free to contact me for any inquiries and comments!

Comments and Discussions