user353682
user353682

Reputation: 321

delete hibernate entity question?

i want to delete a row and cascade all foreign keys in hibernate i am new to hibernate and i want to know if there's a method to delete an entity>> session.delete(); like the session.save and session.update methods in hibernate?

Upvotes: 1

Views: 2197

Answers (1)

Bozho
Bozho

Reputation: 597314

Yes, hibernate's Session has delete(entity) method.

If you want to cascade dependencies, you'd have to set @*ToMany(cascade=CascadeType.DELETE)

Upvotes: 1

Related Questions