Our mappings are too complex.. I can try and re-create a simpler example @ home tonight.
I figured it out though... SaveOrUpdate(Customer); Persist(Order); provides me with the Id I want but my question still remains. Every time I've seen persist mentioned it's specified that the Id is NOT guaranteed so I can't rely on this can I? On Jan 5, 3:06 pm, Fabio Maulo <[email protected]> wrote: > mappings man!! mappings.... > > 2010/1/5 Shane C <[email protected]> > > > > > Oh and I should point out that Persist also results in an error for > > us.. > > > "detached entity passed to persist:" > > > On Jan 5, 2:59 pm, Shane C <[email protected]> wrote: > > > Assume we are using seqhilo and we have the following... > > > > Customer > > > has many -> Order > > > > When I get a new Order in I add it to the Customer and then > > > SaveOrUpdate the customer. At this point my Order won't have an Id > > > until I call a Flush(). > > > > After a bit of reading I'm not sure how to get Order to have an Id > > > without saving it directly and then adding it to the Customer. There > > > is talk about Persist() but it's not guaranteed to provide an Id so > > > that means it's not a viable option. > > > > Any suggestions on how to get around this if we need the Id? > > > -- > > 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]<nhusers%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en. > > -- > 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.
