[TYPO3-mvc] Clear repository - was: delete/truncate SQL statements

Martin Kutschker masi-no at spam-typo3.org
Wed Jan 27 15:55:32 CET 2010


Jochen Rau schrieb:
> Removing all
> Aggregate Roots from a Repository (and deleting them from the database)
> is easy, but what to do with Posts, Tags, Comments, Administrators,
> attached files?

If you remove all aggregate root from one aggregate you must remove all other objects from it as you
 can access objects only from the aggregate roots.

> If a Blog is removed all its Posts should also be
> removed, but not the Administrator of the Blog.

I guess you are referring to relations to other aggregates. Well, as i have said before, any delete
may break a relation unless it is being track eg by a foreign key on the DB level or by the
"application" (or better the persistence layer). But TYPO3 v4 will assist you not directly in
tracking the relations via TCA. But you can look any relations up in the reference table. Before
deleting any record/object you can check if it related to elsewhere. Something the BE should do but
doesn't.

Anyway, my request for the "clear aggregate" operation is based only on a wish to make tests and
debuggings easier. You probably won't need such an operation in production.

Masi


More information about the TYPO3-project-typo3v4mvc mailing list