Scenario: An existing product line, adding new traffic line to that
product line. Attaching the children (traffic lines) to the existing
product line through helper:
ProductLine 1:M TrafficLine
newTrafficLine.ProductLine = this; //associating the child with the
parent
Hello all,
new to the list, hope I'll be able to contribute as well :)
Before I begin, here's a bit of background: I'm working on a library
cataloguing application using NHibernate + Spring.Net (the latest
versions for both) strictly for educational reasons...
The exception I've mentioned is
2008/12/8 Renso [EMAIL PROTECTED]
Why does it not perform the select to retrieve the newly generated id
when I SaveOrUpdate on the parent (product line)?
Because NH delay the DB access as late as possible.If you really need the ID
and you want force the DB access you have two choice:
1)
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);)?
2. Why does it work differently than the SaveOrUpdate on the parent?
3. Is there a post somewhere that explains this i depth
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
Hi Fabio, to answer your question and to clarify my answer:
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
Hi Renso.Please try to buy NHibernate in Action book.
2008/12/8 Renso [EMAIL PROTECTED]
Hi Fabio, to answer your question and to clarify my answer:
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
I have created a PostLoadEventListener the throws an error but I
cannot catch that error since
this swallows the error. Is this an error, oversight or something
else?
private IList DoQueryAndInitializeNonLazyCollections(
ISessionImplementor session,
this doesn't swallow any errors.
On Mon, Dec 8, 2008 at 11:48 AM, epitka [EMAIL PROTECTED] wrote:
I have created a PostLoadEventListener the throws an error but I
cannot catch that error since
this swallows the error. Is this an error, oversight or something
else?
private IList
Please try to buy NHibernate in Action book.
This book is final ? I bought the MEAP a long long time ago but I never see
the final (I think)
Regards,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
nhusers group.
Yes Kris, the final is not out yet :-(
Just to get back to my topic, would all here agree that in order to
get the id (by the way Persist() does not perform a insert and select
to get the newly generated id) for an newly added child, regardless
for the reason why, that I need to call Save on
What is the recommended way to generate a zero-based index for an
IList mapping?
?xml version=1.0 encoding=utf-8 ?
hibernate-mapping xmlns=urn:nhibernate-mapping-2.2
assembly=Domain namespace=Domain
class name=ProductLine table=ProductLine
id name=Id column=Id type=int
Hi,
I would like to filter the data that is being retrieved by NH from the
database. I have a class projecttype, which holds a collection of
projectsteps. But I only want to load those steps that are active.
So I figured I could define a filter in the mapping somewhere, so that
I don't have to
Hi.
I'm looking for best practices to sync multiple clients. In my domain
I have some bigger changes (for example generating many new lines in a
couple of tables or changing a state (and a couple of other
properties) for many lines). In another scenario (not that important
for my current
Check out section 6.2 at
http://www.hibernate.org/hib_docs/nhibernate/html/collections.html
Specifically, there is a where attribute that allows you to filter a mapped
collection based on arbitrary sql.
-Original Message-
From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On
I get these,
WARN NHibernate.Engine.Loading.LoadContexts [(null)] - fail-safe
cleanup (collections) :
NHibernate.Engine.Loading.CollectionLoadContextrs=NHibernate.Driver.NHybridDataReader
probably related to that:
from Page page
left join fetch page.Parent p
left join fetch
2008/12/8 Roger Kratz [EMAIL PROTECTED]
I don't think anything is wrong really/nothing you have written wrong.
Hibernate had the same problem.
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2936
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2795
Probably some
17 matches
Mail list logo