I have a question about object relational updates on join fields.
I am working on a project using codeigniter with datamapper dmz. But I think my problem is with general understanding of ORMs. So fell free to answer with any ORM you know.
I have two tables, Goods and Tags. One good can have many tags. Everything is working, but I am looking for a way to merge tags. Meaning I decide I want to remove tag A and instead have everything that is tagged by it, now be tagged by tag B.
I only have models for the goods and the tags. There is no separate model for the join relationship, as I believe these ORMs were designed to work.
I know how to delete a tag. But I dont know how to reach into the join table to redirect the references since there is no model for the join table. I would rather use the ORM then issuing a raw SQL command.
This sounds like something you need to do in the application language. I.e. for Java:
Now this only removes a tag from one object and puts a different one on it. To eliminate a tag from the database completely and replace it with another existing tag, you could repeat those steps in the application language or do it in the database language:
Or: