2008/12/8 Renso <[EMAIL PROTECTED]>

>
> Fabio, thank you very much for your reply.
>
> 1. Do you know why it does return the id when you perform a SAVE
> directly on the child (_traffcLineDao.Save(newTrafficLine);)?


Yes. you are explicit persisting an entity avoiding automatic cascade.


> 2. Why does it work differently than the SaveOrUpdate on the parent?


Because the parent is a RootEntity and the ID are needed before
save children.


>
> 3. Is there a post somewhere that explains this i depth that you know
> of?


May be documentation or, in alternative, this post.


> I would imagine that it should be very common to retrieve the ids
> right away after an object is persisted (i.e. before the session is
> finally flushed), like when lists are returned, so that when a user
> clicks on a specific listed item it will have the id already in it so
> that the server knows which child was selected. This is especially
> true when you look at the suggestions from the NHibernate docs where
> ids are recommended rather than natural keys, as in many cases like
> list of addresses, etc, it is not possible to identify a unique
> address by its content/natural keys (for example 100 Main Street is
> the same as Main Street No 100).


I don't understand what you are talking about. If the ID have no meaning why
your user must see it ?
If you need to know which element is selected you may use the index of the
list, if you are using ISet you should implement an EqualityComparer.


>
> 4. I would like to understand how the different persistence options
> work, pros and cons so I can make an informed decision on which one to
> use.


Probably in some course.

-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to