samujob wrote:
I think if you just plan to read the data you could write a class and map it to the subset of column you want to read (you have to include the PK ofcourse). This way NHibernate will only select the mapped columns when loading the object. However you will not be able to update/insert as NHibernate does not know about other columns.
I do not know about MySQL so no comments on that.
The best way to learn HQL would be to try it out. Get hold of "Hibernate in Action" book, its a great help in learning NHibernate. Although it is for the java version but the API's are almost the same so you will not find any difficulty in using it.
Samujob, but should I have to create one class for query? For example:
Code:
SELECT id, a FROM table
In this case, should I create a Class named A with the fields "id" and "a"?
I think there is another way...
Using HQL, it seems simple. But with ICriteria? Do you know?
Tks