[JIRA] Commented: (CAY-935) DataMap.remove*Entity does not remove

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Mon Dec 10 2007 - 04:59:43 EST

  • Next message: Tore Halset (JIRA): "[JIRA] Resolved: (CAY-935) DataMap.remove*Entity does not remove"

        [ https://issues.apache.org/cayenne/browse/CAY-935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12619 ]

    Andrus Adamchik commented on CAY-935:
    -------------------------------------

    Unfortunately we can't _consistently_ refresh namespace on DataMap children changes. Changes to almost all properties of an entity (e.g. "name" ) would result in namespace being in an inconsistent state. So the current mode of operation is that if a user changes something in the DataMap in runtime, user is responsible for resetting EntityResolver via 'clearCache'... Otherwise we'd have to implement full child-parent event notification mechanism in the mapping layer (something we started doing ca. 1.0 with a Modeler in mind, but never cared enough to actually finish).

    > DataMap.remove*Entity does not remove
    > -------------------------------------
    >
    > Key: CAY-935
    > URL: https://issues.apache.org/cayenne/browse/CAY-935
    > Project: Cayenne
    > Issue Type: Bug
    > Components: Cayenne Core Library
    > Affects Versions: 3.0
    > Environment: trunk as of today
    > Reporter: Tore Halset
    > Assignee: Andrus Adamchik
    > Fix For: 3.0
    >
    >
    > I am writing a junit test and are trying to do a DataMap.removeObjEntity and DataMap.removeDbEntity. The DataMaps dbEntityMap and objEntityMap are updated as expected, but DataMap.getObjEntity and DataMap.getDbEntity still finds the removed entities. The "problem" seem to be that the namespace still have them.
    > So perhaps DataMap.remove*Entity should clear/reset the namespace?
    > map.removeObjEntity(objEntity.getName(), true);
    > map.removeDbEntity(dbEntity.getName(), true);
    > assertNull(map.getObjEntity(objEntity.getName())); // fails
    > assertNull(map.getDbEntity(dbEntity.getName())); // fails
    > Am I doing something wrong?

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Mon Dec 10 2007 - 05:00:07 EST