[TYPO3-mvc] Clear repository - was: delete/truncate SQL statements
Jochen Rau
jochen.rau at typoplanet.de
Thu Jan 28 17:19:03 CET 2010
Hi Masi.
On 27.01.10 15:55, Martin Kutschker wrote:
> 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.
That's true. This is how FLOW3 handles this. But we (Sebastian, Karsten
and I) decided to make the above described behavior the default for
Extbase. Extbase is only half-way to the future ;-).
>> 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.
It should definitely. In my experience, you can't always rely on the
reference table unless you have updated it. I will implement an
update-hook for every delete process of Extbase now ;-)
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list