I do not know that this does not seem right to you, it is not. Infact its so wrong that it hurts! But instead of just giving you grief, poorly explain the whole reason why this is wrong @
Firstly, your download in ALL cases is brought into memory from the database, this essentially means that you request a data warehouse to get the entire amount of data that you do not need, and then transfer it via cable. This is normal if you have several trips, but it will not scale at all.
Then you return through each trip and name the property "trip.People". Then it will go back to the database and upload ALL the data for people on EVERY one of these trips. Again, this will kill you if you have multiple trips with multiple participants. Now, this assumes that you do not have filters on your mappings, or you specifically asked NHibernate not to be lazy to download the People collection, but in any case you do not want to download all the information.
My advice would be to look at NHibernate docs regarding querying your object model using either HQL or Linq-To-NHibernate and you will get queries that look something like this:
HQL (MY HQL Sucks, so this can be very wrong):
var hql = @ "from Trip as t Join t.People as p with p.Account.Id =: accountId select t"
Edit:
Actually, my brain is a little slow right now, because it is late, but I just realized that you are doing it a bit here. In fact, in fact, after all the trips that a person had, why does your account object have no correlation with traffic? You should essentially aim for something like this:
var trip = accountRepo.GetAccount (123) .Trips;
Edit:
I'm tired again, so that might be nonsense, but I think the matching you are looking for will look like this:
<bag name="Trip" cascade="all" table="TripToAccount" lazy="true"> <key column="AccountId" /> <many-to-many class="Trip"> <column name="TripId" not-null="true"/> </many-to-many> </bag>
Edit:
Gosh, I have to go to bed. Now I see that you already have a comparison between people and their trips, so why not:
var query = "from TripPeople as tp Where tp.Account.Id =: accountId AND tp.IsActive = true select tp.Trip"
Now we stop responding before doing more stupid things.