{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/7986","repository_url":"https://api.github.com/repos/jhipster/generator-jhipster","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/7986/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/7986/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/7986/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/7986","id":341809210,"node_id":"MDU6SXNzdWUzNDE4MDkyMTA=","number":7986,"title":"React - id value not present when linking through field on a relationship using JDL -> Entity{fk(field)}","user":{"login":"delkant","id":1325846,"node_id":"MDQ6VXNlcjEzMjU4NDY=","avatar_url":"https://avatars3.githubusercontent.com/u/1325846?v=4","gravatar_id":"","url":"https://api.github.com/users/delkant","html_url":"https://github.com/delkant","followers_url":"https://api.github.com/users/delkant/followers","following_url":"https://api.github.com/users/delkant/following{/other_user}","gists_url":"https://api.github.com/users/delkant/gists{/gist_id}","starred_url":"https://api.github.com/users/delkant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delkant/subscriptions","organizations_url":"https://api.github.com/users/delkant/orgs","repos_url":"https://api.github.com/users/delkant/repos","events_url":"https://api.github.com/users/delkant/events{/privacy}","received_events_url":"https://api.github.com/users/delkant/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-17T08:06:10Z","updated_at":"2018-07-18T09:38:59Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n- Please follow the issue template below for bug reports.\r\n- If you have a support request rather than a bug, please use [Stack Overflow](http://stackoverflow.com/questions/tagged/jhipster) with the JHipster tag.\r\n- For bug reports it is mandatory to run the command `jhipster info` in your project's root folder, and paste the result here.\r\n- Tickets opened without any of these pieces of information will be **closed** without any explanation.\r\n-->\r\n\r\n##### **Overview of the issue**\r\n\r\n<!-- Explain the bug, if an error is being thrown a stack trace helps -->\r\nNo id present when updating an entity if the relationship was defined to be linked through field different from default(the ID)\r\ni.e.(using name):\r\n`relationship OneToMany {\r\n  Author{book(name)} to Book{writer(name)}\r\n}`\r\n##### **Motivation for or Use Case**\r\nUpdating an existing value on DB.\r\n<!-- Explain why this is a bug for you -->\r\nServer will throw and exception since the id of the relationship(which exists) is not present. Even if you are changing other fields(leaving the relationship as it is)\r\n##### **Reproduce the error**\r\nUpdate a value on an existing record;\r\n\r\nTransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing\r\n\r\n<!-- For bug reports, an unambiguous set of steps to reproduce the error -->\r\n\r\n##### **Related issues**\r\nMaybe: https://github.com/jhipster/generator-jhipster/issues/7967#issuecomment-405064024\r\n<!-- Has a similar issue been reported before? Please search both closed & open issues -->\r\n`<AvInput id=\"blog-user\" type=\"hidden\" name=\"user.id\" value={this.state.userId} />\r\n`\r\n5.1.0 did not generated above code. I added the code in 5.1.0 and works perfectly.\r\n\r\n##### **Suggest a Fix**\r\n\r\n<!-- If you can't fix the bug yourself, perhaps you can point to what might be\r\n  causing the problem (line of code or commit) -->\r\n\r\n##### **JHipster Version(s)**\r\n5.1.0\r\n<!--\r\nWhich version of JHipster are you using, is it a regression?\r\n-->\r\n\r\n##### **JHipster configuration**\r\n\r\n<!--\r\nTo provide all information we need, you should run `jhipster info` in the project root folder, and\r\ncopy/paste the result here.\r\nThe `.yo-rc.json` file generated in the root folder is mandatory for bug reports. This will help us to replicate the scenario.\r\nYou should remove any sensitive information like the rememberMe key or the jwtSecretKey key.\r\n-->\r\n```\r\n{\r\n  \"generator-jhipster\": {\r\n    \"promptValues\": {\r\n      \"packageName\": \"com.test\",\r\n      \"nativeLanguage\": \"en\"\r\n    },\r\n    \"jhipsterVersion\": \"5.1.0\",\r\n    \"applicationType\": \"gateway\",\r\n    \"baseName\": \"PTasks\",\r\n    \"packageName\": \"com.test\",\r\n    \"packageFolder\": \"com/test\",\r\n    \"serverPort\": \"9980\",\r\n    \"authenticationType\": \"uaa\",\r\n    \"uaaBaseName\": \"uaa\",\r\n    \"cacheProvider\": \"hazelcast\",\r\n    \"enableHibernateCache\": true,\r\n    \"websocket\": \"spring-websocket\",\r\n    \"databaseType\": \"sql\",\r\n    \"devDatabaseType\": \"mysql\",\r\n    \"prodDatabaseType\": \"mysql\",\r\n    \"searchEngine\": false,\r\n    \"messageBroker\": false,\r\n    \"serviceDiscoveryType\": \"eureka\",\r\n    \"buildTool\": \"gradle\",\r\n    \"enableSwaggerCodegen\": false,\r\n    \"clientFramework\": \"react\",\r\n    \"useSass\": false,\r\n    \"clientPackageManager\": \"yarn\",\r\n    \"testFrameworks\": [],\r\n    \"jhiPrefix\": \"jhi\",\r\n    \"enableTranslation\": true,\r\n    \"nativeLanguage\": \"en\",\r\n    \"languages\": [\r\n      \"en\",\r\n      \"es\"\r\n    ]\r\n  }\r\n}\r\n```\r\n##### **Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**\r\n\r\n<!--\r\nIf the error is during an entity creation or associated with a specific entity.\r\nIf you are using JDL, please share that configuration as well.\r\n-->\r\n\r\n##### **Browsers and Operating System**\r\n\r\n<!-- What OS are you on? is this a problem with all browsers or only IE8? -->\r\n\r\n- [x] Checking this box is mandatory (this is just to show you read everything)\r\n\r\n<!-- Love JHipster? Please consider supporting our collective:\r\n👉  https://opencollective.com/generator-jhipster/donate -->\r\n"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/405872889","html_url":"https://github.com/jhipster/generator-jhipster/issues/7986#issuecomment-405872889","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/7986","id":405872889,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTg3Mjg4OQ==","user":{"login":"deepu105","id":1107223,"node_id":"MDQ6VXNlcjExMDcyMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1107223?v=4","gravatar_id":"","url":"https://api.github.com/users/deepu105","html_url":"https://github.com/deepu105","followers_url":"https://api.github.com/users/deepu105/followers","following_url":"https://api.github.com/users/deepu105/following{/other_user}","gists_url":"https://api.github.com/users/deepu105/gists{/gist_id}","starred_url":"https://api.github.com/users/deepu105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepu105/subscriptions","organizations_url":"https://api.github.com/users/deepu105/orgs","repos_url":"https://api.github.com/users/deepu105/repos","events_url":"https://api.github.com/users/deepu105/events{/privacy}","received_events_url":"https://api.github.com/users/deepu105/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T09:38:59Z","updated_at":"2018-07-18T09:38:59Z","author_association":"MEMBER","body":"@agaspardcilia can you add fix #no for this as well on the ticket"}}
{"actor":{"display_login":"deepu105"}}