Advertisement
Guest User

Untitled

a guest
May 27th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. I have an idea for a new feature of JPA. There should be a @PreCascade. This would be used in circumstances, for example, when you have an Embeddable PK of a child, that has the ID of the parent.
  2.  
  3. Person (personId auto generated)
  4. -> Address
  5. -> AddressPK(personId, addressType)
  6.  
  7. So, the PK of the address could not be known prior to Person being persisted. So, the only way of doing it right now, is to persist the person, then add an address, and merge the person.
  8.  
  9. With @PreCascade, you would be able to update the addresses with an appropriate primary key, before the cascade occurs.
  10.  
  11. I figured since you're in the loop in most of these circles, I'd suggest it to you.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement