Hi,
If i dont have the parent child relationship for tw0o entities(which are really parent child) but i dont want to associate them, if i would like to load each of the entity by themselves like
session.load(parent,id)
session.load(child,id)
and when i want to save(3 tier - after user inetraction) i might do like this
in a different session--
session.saveorupdate(parent);
session.saveorupdate(child);
-------------------------------------
So what are the pitfalls here if i dont have a relationship and want to load and save each entity on their own, is it like it will create more number of sql queries behind the scene to load or save/update the entities or only the # of lines of code increases since i have to load each one of them and save/update them one by one instead of just having
session.load(parent)---will load everything if i have the relationship
and
session.saveorupdate(parent)
----I wont be able to make use of the lazyloading even when i have set the relationship as the whole object graph need to travel to GUI tier for display purpose and for the user to modify it.
Thanks in advance
|