Announcement Announcement Module
Collapse
No announcement yet.
save operation on persistant parent and transient child Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • save operation on persistant parent and transient child

    I have parent and child with cascade all . In my case I open session, load the parent create a new child (this is transient) and add this child to parent and call save , I was hoping that hibernate would generate the PK for the newly added child , but it did not , it is generating only after flush ,and I if I want to use the PK of this child for some other operation before flush I canot , I want hibernate to generate the PK of the child with call to save on persistant parent , please tell me how to do this ?

  • #2
    Please help me with this. I also posted this in hibernate forums , but the hibernate forums is more towards commercial support they rarely try to help , unless i go for commercial support ,please help me.

    Originally posted by [email protected] View Post
    I have parent and child with cascade all . In my case I open session, load the parent create a new child (this is transient) and add this child to parent and call save , I was hoping that hibernate would generate the PK for the newly added child , but it did not , it is generating only after flush ,and I if I want to use the PK of this child for some other operation before flush I canot , I want hibernate to generate the PK of the child with call to save on persistant parent , please tell me how to do this ?

    Comment

    Working...
    X