{"action":"opened","issue":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/1252","repository_url":"https://api.github.com/repos/grails/grails-data-mapping","labels_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/1252/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/1252/comments","events_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/1252/events","html_url":"https://github.com/grails/grails-data-mapping/issues/1252","id":455160695,"node_id":"MDU6SXNzdWU0NTUxNjA2OTU=","number":1252,"title":"Derived fields with formula not working","user":{"login":"cgoIT","id":8972203,"node_id":"MDQ6VXNlcjg5NzIyMDM=","avatar_url":"https://avatars1.githubusercontent.com/u/8972203?v=4","gravatar_id":"","url":"https://api.github.com/users/cgoIT","html_url":"https://github.com/cgoIT","followers_url":"https://api.github.com/users/cgoIT/followers","following_url":"https://api.github.com/users/cgoIT/following{/other_user}","gists_url":"https://api.github.com/users/cgoIT/gists{/gist_id}","starred_url":"https://api.github.com/users/cgoIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgoIT/subscriptions","organizations_url":"https://api.github.com/users/cgoIT/orgs","repos_url":"https://api.github.com/users/cgoIT/repos","events_url":"https://api.github.com/users/cgoIT/events{/privacy}","received_events_url":"https://api.github.com/users/cgoIT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-12T11:32:16Z","updated_at":"2019-06-12T11:32:16Z","closed_at":null,"author_association":"NONE","body":"### Steps to Reproduce\r\n\r\nI've created a simple demo app which shows my problem. I tried to use a derived field in one of my domain classes using _formula_ in _mapping_ closure. I want to use a subselect to a view. I cannot use some kind of _size()_ method oder something like this in my real app for some special reasons.\r\n\r\nI thought I don't have to use _transients_ for this field. But if I omit this, gorm creates a column in my table for property _projectCount_.\r\n\r\n### Expected Behaviour\r\n\r\nI just want grails/gorm to use my sql statement under _formula_ to be executed if i read the property _projectCount_ of my domain class _Person_.\r\n\r\n### Actual Behaviour\r\n\r\nThe sql statement is never executed and the value of the property _projectCount_ is always 0.\r\n\r\n### Environment Information\r\n\r\n- **Operating System**: Mac OSX 10.14.5\r\n- **GORM Version:** 6.1.10.RELEASE\r\n- **Grails Version (if using Grails):** 3.3.8\r\n- **JDK Version:** OpenJDK 64-Bit Server VM (Zulu 8.38.0.13-CA-macosx) (build 25.212-b04, mixed mode)\r\n\r\n### Example Application\r\n\r\nAn small example project could be found at [https://github.com/cgoIT/grails-formula-bug](https://github.com/cgoIT/grails-formula-bug)\r\n\r\n"}}
{"actor":{"display_login":"cgoIT"}}