php - Doctrine makes update for no reason -
when execute code doctrine changes value in database 0 although never changed value. there isn't setter-method field.
the field part of id.
how can doctrine changes value?
edit
the field belongs entity pagenamespacetranslation, field gets modified doctrine language_id
.
i use xml, not annotations.
<entity name="exodus\domain\meta\pages\namespaces\pagenamespacetranslation" table="page_namespace_translation"> <id name="translated" association-key="true" /> <id name="language_id" type="integer" column="lang_id" /> <many-to-one target-entity="pagenamespace" field="translated" inversed-by="translations"> <join-column name="namespace_id" referenced-column-name="namespace_id" /> </many-to-one>
update
i think have localized problem: have entity called informationobjectaliaspagetranslation
have field called language_id
. column lang_id
used twice: field language_id
, part of foreign key pagenamespacetranslation.
the problem occurs when make following query:
select p exodus\domain\meta\pages\informationobjectaliaspagetranslation p join p.namespace ns join ns.translated nst nst.namespaceid = :ns , p.language_id = :langid , p.title = :title
when add ns
, nst
select problem not occur.
however, when change mapping column lang_id
used once, there no problems.
the mapping of informationobjectaliaspagetranslation
in orginal form:
<entity name="exodus\domain\meta\pages\informationobjectaliaspagetranslation" table="page_translation"> <id name="translated" association-key="true" /> <id name="language_id" type="integer" column="lang_id" /> <many-to-one target-entity="informationobjectaliaspage" field="translated" inversed-by="translations"> <join-column name="page_id" referenced-column-name="page_id" /> </many-to-one> <many-to-one target-entity="exodus\domain\meta\pages\namespaces\pagenamespacetranslation" field="namespace"> <join-columns> <join-column name="namespace_id" referenced-column-name="namespace_id" /> <join-column name="lang_id" referenced-column-name="lang_id" /> </join-columns> </many-to-one>
can double use of column lang_id cause effect?
it seems doctrine not support sharing of columns. behaves strange in case , inserts not possible because columns repeated.
i use solution redundancy instead of using shared columns , seems better solution after because these date read , hardly ever changed.
Comments
Post a Comment