{"action":"created","issue":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/629","labels_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/629/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/629/comments","events_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/629/events","html_url":"https://github.com/grails/grails-data-mapping/issues/629","id":127930315,"number":629,"title":"Neo4j - dynamic property marked as dirty even when it didn't change","user":{"login":"mburak","id":944294,"avatar_url":"https://avatars.githubusercontent.com/u/944294?v=3","gravatar_id":"","url":"https://api.github.com/users/mburak","html_url":"https://github.com/mburak","followers_url":"https://api.github.com/users/mburak/followers","following_url":"https://api.github.com/users/mburak/following{/other_user}","gists_url":"https://api.github.com/users/mburak/gists{/gist_id}","starred_url":"https://api.github.com/users/mburak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mburak/subscriptions","organizations_url":"https://api.github.com/users/mburak/orgs","repos_url":"https://api.github.com/users/mburak/repos","events_url":"https://api.github.com/users/mburak/events{/privacy}","received_events_url":"https://api.github.com/users/mburak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-21T14:01:44Z","updated_at":"2016-01-21T14:10:16Z","closed_at":null,"body":"Setting the same value to a dynamic property is marking it as dirty when it shouldn't.\r\n\r\nShouldn't this be cheked in Neo4jEntity propertyMissing method?\r\n```\r\n    def propertyMissing(String name, val) {\r\n        def unwrappedInstance = unwrappedInstance(this)\r\n        def session = AbstractDatastore.retrieveSession(Neo4jDatastore)\r\n        if (name == Neo4jQuery.UNDECLARED_PROPERTIES) {\r\n            return getOrInitializeUndeclared(session, unwrappedInstance)\r\n        } else {\r\n\r\n            Map undeclaredProps = getOrInitializeUndeclared(session, unwrappedInstance)\r\n            undeclaredProps.put(name, val)\r\n\r\n            def mappingContext = session.mappingContext\r\n            if (mappingContext.isPersistentEntity(val)) {\r\n                session.persist(val)\r\n            } else if (Neo4jSession.isCollectionWithPersistentEntities(val, mappingContext)) {\r\n                session.persist((Iterable)val)\r\n            }\r\n            if (unwrappedInstance instanceof DirtyCheckable) {\r\n                ((DirtyCheckable)unwrappedInstance).markDirty(name)\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\nIt's setting it as dirty even when you can check if the value is the same looking at the undeclaredProps map."},"comment":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/comments/173579847","html_url":"https://github.com/grails/grails-data-mapping/issues/629#issuecomment-173579847","issue_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/629","id":173579847,"user":{"login":"graemerocher","id":66626,"avatar_url":"https://avatars.githubusercontent.com/u/66626?v=3","gravatar_id":"","url":"https://api.github.com/users/graemerocher","html_url":"https://github.com/graemerocher","followers_url":"https://api.github.com/users/graemerocher/followers","following_url":"https://api.github.com/users/graemerocher/following{/other_user}","gists_url":"https://api.github.com/users/graemerocher/gists{/gist_id}","starred_url":"https://api.github.com/users/graemerocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graemerocher/subscriptions","organizations_url":"https://api.github.com/users/graemerocher/orgs","repos_url":"https://api.github.com/users/graemerocher/repos","events_url":"https://api.github.com/users/graemerocher/events{/privacy}","received_events_url":"https://api.github.com/users/graemerocher/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T14:10:16Z","updated_at":"2016-01-21T14:10:16Z","body":"Yup seems like this could be improved."}}