"onDelete = ForeignKeyAction.CASCADE" with no effects
See original GitHub issueI try to use the “onDelete” with ForeignKeyAction.CASCADE but without success. I have the following annotation in a class that we will call MyClass:
@Column(columnType = Column.FOREIGN_KEY, references = {@ForeignKeyReference(columnName = FIELD_MEDIA, columnType = Long.class, foreignColumnName = "id")}, onDelete = ForeignKeyAction.CASCADE, saveForeignKeyModel = false, uniqueGroups = 1)
protected Media media;
But when i do this
new Delete().from(MyClass.class).query();
The Media is not deleted. Any idea why?
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Active Android onDelete and onDelete - Stack Overflow
NO ACTION: Configuring "NO ACTION" means just that: when a parent key is modified or deleted from the database, no special action is...
Read more >Using the ON DELETE CASCADE Option - IBM
Use the ON DELETE CASCADE option to specify whether you want rows deleted in a child table when corresponding rows are deleted in...
Read more >13.1.20.5 FOREIGN KEY Constraints - MySQL :: Developer Zone
A foreign key constraint on a stored generated column cannot use CASCADE , SET NULL , or SET DEFAULT as ON UPDATE referential...
Read more >ForeignKey - Android Developers
A "CASCADE" action propagates the delete or update operation on the parent key to each dependent child key. For onDelete() action, this means...
Read more >Foreign Key Constraint | CockroachDB Docs
ON DELETE CASCADE / ON UPDATE CASCADE, When a referenced foreign key is ... does not have a NOT NULL constraint, this will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@YSDC do you have foreign key constraints turned on?
@Database(foreignKeysSupported = true)
?I was wondering what’s currently the preferred way of making a OneToOne-Relation work. I’m struggling with getting it to work when I’m following the current Document of DBFlow 4.0.4.