1) create a new session
2) assuming that you setup cascades correctly, yes.

On Sat, Sep 27, 2008 at 5:43 PM, antoschka <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I have a normalized data model and 1to1 mapping NH-Mapping The basic
> idea. A person can be assigned to multiple nodes in a structure. In
> each node it has specific attributes. To give a snappshot of the
> physical datamodel
> 1. table "person"
> 2. table "assignPersonToNode" (ForeignKey to person & node)
> 3. table "node"
> 4. table "attributeInNode" (ForeignKey to node)
> I retrieve entities from the database and bind them over wrapper-
> classes to controls. In my case I retrieve persons and nodes bind them
> to a treeView and when the user selects a node in a structure
> Attributes are displayed in ListView. Actually it works really well
> but now I'm a kind of uncertain about the strategy to persist or
> dispose non-persistent entities.
> When I add a new entry e.g a new person to node in a structure, I
> actually need to add several new entities:
> - one entity in table 1-3 and depending on the number of attributes
> - one or more entities in table 4
>
> This also works well. in all tables i used an Id column which is
> defined in the mapping file as integer increment.
> The non-persistent entities have all id = 0  and now the application
> gives the user the option cancel and all new information shall be
> forgotten or to save the new entry.
>
> For both options how you proceed with non-persistent entities:
> Option one: how can I efficiently get rid of all non-persistent
> entities (evict session?)
> Option two: how can I efficiently persist the non-persistent entities
> (would a flush be enough?)
>
> Thanks for your guidance
>
> antoschka
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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