Hibernate version: 1.2.0
Mapping documents:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="ClearCanvas.Healthcare" namespace="ClearCanvas.Healthcare">
<class name="AddressTypeEnum" proxy="AddressTypeEnum" table="AddressTypeEnum_">
<id name="Code" column="Code_" type="String">
<generator class="assigned"/>
</id>
<property name="Value" column="Value_" type="String" length="50"/>
<property name="Description" column="Description_" type="String" length="200"/>
<property name="DisplayOrder" column="DisplayOrder_" type="Single"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
IQuery q = session.CreateQuery("from AddressTypeEnum order by DisplayOrder asc");
q.Find();
Name and version of the database you are using:SQL server 2005 (but using SQL server 2000 dialect)
The generated SQL (show_sql=true):Code:
NHibernate: select addresstyp0_.Code_ as Code1_26_, addresstyp0_.Value_ as Value2_26_, addresstyp0_.Description_ as Descript3_26_, addresstyp0_.DisplayOrder_ as
DisplayO4_26_ from Ris4.dbo.AddressTypeEnum_ addresstyp0_ order by DisplayOrder asc
Note the order by clause. The DisplayOrder property is not mapped to the database column. Anyone know if there is a fix for this?