Re: Help: Cannot set the read only flattened relationship x

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jul 01 2004 - 13:25:45 EDT

  • Next message: Andrus Adamchik: "Re: Parent to Grandchild Relationships"

    Mike,

    I just reproduced the problem. It is due to the fact that relationships
    from "prject_phase" join table are incorrectly mapped as to-many. Change
    "project_phase.phases" and "project_phase.phases" to be to-one...

    I did a few more fixes to the relationships, etc. I set to-dep-pk
    correctly, and also got rid of project_phase.pkey column as it is
    redundant (and actually its presence prevents flattened rels from
    working). Here is the new map highlights:

            <db-entity name="phase" catalog="ttdb">
                    <db-attribute name="active" type="TINYINT" isMandatory="true" length="1"/>
                    <db-attribute name="description" type="VARCHAR" length="255"/>
                    <db-attribute name="name" type="VARCHAR" isMandatory="true" length="15"/>
                    <db-attribute name="pkey" type="INTEGER" isPrimaryKey="true"
    isMandatory="true" length="11"/>
            </db-entity>
            <db-entity name="project" catalog="ttdb">
                    <db-attribute name="active" type="TINYINT" isMandatory="true" length="1"/>
                    <db-attribute name="description" type="VARCHAR" length="255"/>
                    <db-attribute name="name" type="VARCHAR" isMandatory="true" length="15"/>
                    <db-attribute name="pkey" type="INTEGER" isPrimaryKey="true"
    isMandatory="true" length="11"/>
            </db-entity>
            <db-entity name="project_phase" catalog="ttdb">
                    <db-attribute name="phase_id" type="INTEGER" isPrimaryKey="true"
    isMandatory="true" length="11"/>
                    <db-attribute name="project_id" type="INTEGER" isPrimaryKey="true"
    isMandatory="true" length="11"/>
            </db-entity>

            <db-relationship name="projectLink" source="phase" target="project_phase"
    toDependentPK="true" toMany="true">
                    <db-attribute-pair source="pkey" target="phase_id"/>
            </db-relationship>
            <db-relationship name="phaseLink" source="project" target="project_phase"
    toDependentPK="true" toMany="true">
                    <db-attribute-pair source="pkey" target="project_id"/>
            </db-relationship>
            <db-relationship name="phases" source="project_phase" target="phase"
    toMany="false">
                    <db-attribute-pair source="phase_id" target="pkey"/>
            </db-relationship>
            <db-relationship name="projects" source="project_phase" target="project"
    toMany="false">
                    <db-attribute-pair source="project_id" target="pkey"/>
            </db-relationship>



    This archive was generated by hypermail 2.0.0 : Thu Jul 01 2004 - 13:25:46 EDT