Updating join fields in an ORM command
Posted
by Jono
on Stack Overflow
See other posts from Stack Overflow
or by Jono
Published on 2010-06-11T19:12:14Z
Indexed on
2010/06/11
19:32 UTC
Read the original article
Hit count: 325
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.
© Stack Overflow or respective owner