Top "Cascade" questions

Cascade refers to a table-definition keyword in relational databases; it instructs the query engine to take a certain action (delete, update), when a primary key is modified, on tables linked by a foreign key.

Django: merging objects

I have such model: class Place(models.Model): name = models.CharField(max_length=80, db_index=True) city = models.ForeignKey(City) …

python django foreign-keys cascade
Delete rows from two tables in one query

I have two tables: orders and orders_items. Both sharing the field orderID. I want to delete all rows from …

mysql cascade
How to show related items using DeleteView in Django?

I am doing a view to delete (using the generic view DeleteView from Django) an instance from a model, but …

django view cascade
How do I create a Rails migration that updates a foreign key with an on-delete cascade constraint?

I’m using Rails 4.2.3 and a PostgreSQL database. I want to write a migration to update one of my foreign …

ruby-on-rails-4 foreign-keys migration constraints cascade
NHibernate Cascade none still updating related entity

I am then using Fluent NHibernate and its automapping feature to map the the following simplified POCO classes: public class …

nhibernate fluent-nhibernate cascade many-to-one
SQL Server - Cascading DELETE with Recursive Foreign Keys

I've spent a good amount of time trying to figure out how to implement a CASCADE ON DELETE for recursive …

sql sql-server recursion constraints cascade
T-SQL: DROP Table cascade constraints equivalent?

In oracle, I can issue a DROP TABLE ... cascade constraints and it won't complain about FKs, etc. Is there an …

tsql cascade
Hibernate: Clean collection's 2nd level cache while cascade delete items

I have a problem Hibernate does not update 2nd level cache for a collection of items which are subject of …

java hibernate caching cascade second-level-cache
Django on_delete=models.CASCADE has no effect at SQL level

My models.py file contains: class User(models.Model): email = models.CharField(max_length=100, unique=True) password = models.CharField(max_…

python mysql django cascade cascading-deletes
java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST

I have two 2 classes in relation many to many. @Entity @Table(name = "recipies") public class Recipie implements Serializable { @Id @GeneratedValue(…

jpa many-to-many cascade illegalstateexception persist