I use ORM ku ActiveAndroid in the project. There was a problem that the cascade was not working. Not only did I not find the cascade insert, so the existing update and delete cascade also do not work. For example, so I specify the cascade:

@Column(name = "purchaseCalculation", onDelete = Column.ForeignKeyAction.CASCADE, onUpdate = Column.ForeignKeyAction.CASCADE) 

But in fact, the cascade works only for nesting at 1 level. For example, there is the User class, it contains an array of Item objects, which in turn contain Info . I delete User and expect all related objects to be deleted, but in fact only Item deleted, and Info remains.

Is there also a way to make a cascade insert?

  • Show the table creation script - most likely the problem is there. - Barmaley
  • what script? did you work with ActiveAndroid? - IP696
  • To understand the cascade deletion / insertion, it is not necessary to know ActiveAndroid — it’s enough to understand the general principles. Interested in the script create table , which generates your ORM - Barmaley
  • All the ORM are certainly different, because I do not write any scripts. everything is created automatically. I annotate classes and expand from Model. Orme does everything herself. the cascade is indicated in the annotations to the fields. just look at the docks of the orm, maybe you will understand better than me. maybe I missed something, and my comrades github.com/pardom/ActiveAndroid/wiki ... ... the first link in google is IP696

1 answer 1

The answer is found. It's impossible. do so link