Hello,
I write this :
IQuery query = session.CreateQuery("select c from Customer as c");
var result = query.Enumerable<Customer>().ToList();
As I show sql generated by nhibernate, I realized that it sends a request per lines of my customer table :
NHibernate: SELECT customer0_.clicocl as clicocl0_0_, customer0_.clidcfa as clid
cfa0_0_, customer0_.cliddfa as cliddfa0_0_ FROM clients customer0_ WHERE custome
r0_.clicocl=?; p0 = '1'
NHibernate: SELECT customer0_.clicocl as clicocl0_0_, customer0_.clidcfa as clid
cfa0_0_, customer0_.cliddfa as cliddfa0_0_ FROM clients customer0_ WHERE custome
r0_.clicocl=?; p0 = '2'
...
So it is very slow to collect all my customers...
Why don't it just send something like this:
select * from customers
Should I write things differently ?
thanks for any help,
mathmax
|