Re: [nhusers] How to determine number of children of a record?

14 views
Skip to first unread message

Ramon Smits

unread,
Aug 21, 2012, 3:39:48 AM8/21/12
to nhu...@googlegroups.com

Yes, mark the collection extra lazy... and then just do class.Students.Length which will load load the student records but only does a SELECT COUNT(*)

On Mon, Aug 20, 2012 at 11:01 PM, Gustavo Souza Gonçalves <gustavosou...@gmail.com> wrote:
Good afternoon everyone!

I'm studying NHibernate, and decided to make some changes. Among them, I noticed that some fields are unnecessary. So I bring my doubt:
I have a list, let's call it Class_List within each study class, I can have N students for each class. Within the list Class_List, I also have other properties as simple as the name of the class.
How I see it is unnecessary to store how many students I have in the database, I would, in a single query, how many records I have. This, using NHibernate.

Is this possible? How?

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/EA3iAvR1J0oJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.



--
Ramon

Ricardo Peres

unread,
Aug 21, 2012, 6:18:52 AM8/21/12
to nhu...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages