reset password
Author Message
lmann2
Posts: 156
Posted 16:21 Jan 29, 2015 |

Do we need to "create sequence hibernate_sequence;" in the create and drop scripts?  If so, why?

Also, should we mannually add on delete/update cascade to our scripts?  I see that this annotation adds this (cascade={CascadeType.PERSIST, CascadeType.REMOVE}) --specifically on the relations ), but it's one more layer of things to understand in a already tight deadline.

Last edited by lmann2 at 16:22 Jan 29, 2015.
nahmed5
Posts: 57
Posted 16:29 Jan 29, 2015 |

I have the exactly same problem. I spent last whole night trying to figure it out yet I couldn't do it. I also need to figure out the Cascade to pass my scripts in pgAdmin. Prof, please help!

cysun
Posts: 2935
Posted 16:35 Jan 29, 2015 |

1. Yes. The sequence is used by Hibernate to generate new ids.

2. No. Cascade in JPA and cascade in SQL mean different things.