tags:

views:

31

answers:

1

I am going through the book NHIbernate in Action. I have read querying chapters in it which I understood also using ICriteria and IQuery. But I came across one more topic Queries for Objects....What does this statement mean actually?

There was a query "from Bid" which retrieves all instances of a particular persistent class. Wasn't this type of query used to query the records from the database table which stores the data of objects. How can we retrieve all the instances of the persistent class?

A: 

CreateQuery("from Bid") returns all the persistent instances of Bid.

NHibernate queries operate on objects, not on tables.

CreateSQLQuery is used when actual SQL is needed, and even that can return object instances if you want.

Diego Mijelshon