Thursday, August 21, 2008

The Hibernate Query Language - HQL

NHibernate is equipped with an extremely powerful query language that looks very much like SQL. Hibernate Query Language (HQL) is fully object-oriented, understanding notions like inheritence, polymorphism and association.

The simplest possible Hibernate query is of the form:
- "From Employee" - (similar to SQL "Select * From Employeetbl"
* Employee is a mapping class
if you map the table Employeetbl to a mapping class, so you can use the HQL to select from the mapping file.

Example of Mapping Class for NHibernate
<class table="Employeetbl" name="Employee" lazy="false">
<id type="string" column="Employeeid" name="Employeeid">
<generator class="increment">
</id>
<property type="string" column="EmployeeName" name="EmployeeName"></property>
</class>

2 comments:

Stretching said...

WoW nice blog buddy!Actually WoW is my favorite appreciation keyword.I also like to play. Wow Gold. I was looking for info regarding that and saw your website. Its nice and very interesting.

GuildWars2Items said...

The past is gone and static. Nothing we can do will change it.scarlet blade gold, the future is before us and dynamic. Everything we do will affect it rs gold, You laugh at mescarlet blade gold for being different , but I laugh at you for being the same.

Your future depends on your dreams. So go to sleep Diablo 3 Gold, he time of life is short ; to spend that shortness basely, it would be too long C9 Gold, It's great to be great, but it's greater to be human C9 Gold Sale. People who are serious about the relation are moody as they have devoted a lot that makes them worry about gains and losses.