{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/jhipster-uml/issues/192","repository_url":"https://api.github.com/repos/jhipster/jhipster-uml","labels_url":"https://api.github.com/repos/jhipster/jhipster-uml/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/jhipster-uml/issues/192/comments","events_url":"https://api.github.com/repos/jhipster/jhipster-uml/issues/192/events","html_url":"https://github.com/jhipster/jhipster-uml/issues/192","id":160652794,"number":192,"title":"Circular dependency when adding two relationships between two entities","user":{"login":"Paul-Etienne","id":15669805,"avatar_url":"https://avatars.githubusercontent.com/u/15669805?v=3","gravatar_id":"","url":"https://api.github.com/users/Paul-Etienne","html_url":"https://github.com/Paul-Etienne","followers_url":"https://api.github.com/users/Paul-Etienne/followers","following_url":"https://api.github.com/users/Paul-Etienne/following{/other_user}","gists_url":"https://api.github.com/users/Paul-Etienne/gists{/gist_id}","starred_url":"https://api.github.com/users/Paul-Etienne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paul-Etienne/subscriptions","organizations_url":"https://api.github.com/users/Paul-Etienne/orgs","repos_url":"https://api.github.com/users/Paul-Etienne/repos","events_url":"https://api.github.com/users/Paul-Etienne/events{/privacy}","received_events_url":"https://api.github.com/users/Paul-Etienne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jhipster/jhipster-uml/labels/scheduler","name":"scheduler","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-16T12:46:00Z","updated_at":"2016-06-16T15:30:58Z","closed_at":null,"body":"### The issue\r\n\r\nUsing the JDL language, I am trying to create two entities and link them with two relationships of type OneToOne and OneToMany.\r\nIn my example, there are two entities : Country and City. I want the Country to have a list of cities and I want it to hold a reference to a single city as well, the city being the capital of this country.\r\n\r\nI am doing this on a fresh install of jHipster.\r\n\r\n---\r\n#### The stacktrace\r\n\r\nHere's the error I am getting when executing the command \"jhipster-uml\" :\r\n\r\n```\r\nAn error has occurred:\r\n\tCircularDependencyException\r\nError message:\r\n\tThere is a circular dependency in the model.\r\nThe processed entities so far: [ No entity could have been handled. ]\r\nThe elements that still needed processing: [ Source entity: Country, destination entity: City, cardinality: one-to-one,Source entity: Country, destination entity: City, cardinality: one-to-many ].\r\nStack trace:\r\nError\r\n    at Object.<anonymous> (/usr/local/lib/node_modules/jhipster-uml/lib/exceptions/circular_dependency_exception.js:7:41)\r\n    at Module._compile (module.js:541:32)\r\n    at Object.Module._extensions..js (module.js:550:10)\r\n    at Module.load (module.js:458:32)\r\n    at tryModuleLoad (module.js:417:12)\r\n    at Function.Module._load (module.js:409:3)\r\n    at Module.require (module.js:468:17)\r\n    at require (internal/module.js:20:19)\r\n    at Object.<anonymous> (/usr/local/lib/node_modules/jhipster-uml/lib/scheduler.js:6:35)\r\n    at Module._compile (module.js:541:32)\r\n```\r\n\r\n---\r\n\r\n### Steps to reproduce\r\n\r\nSimply create a jhipster app from scratch, create a model.jh with the code below, execute the command jhipster-uml model.jh and look at the error.\r\n\r\n---\r\n\r\n### The XMI or JDL file\r\n\r\nHere's the JDL code :\r\n\r\n```\r\nentity Country {\r\n\tname String\r\n}\r\nentity City {\r\n\tname String\r\n}\r\n\r\nrelationship OneToOne {\r\n\tCountry{capital} to City\r\n}\r\nrelationship OneToMany {\r\n\tCountry{city} to City{country}\r\n}\r\n```\r\n\r\n---\r\n\r\n### Versions\r\n\r\nThe version I am using is v1.6.5.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jhipster/jhipster-uml/issues/comments/226522021","html_url":"https://github.com/jhipster/jhipster-uml/issues/192#issuecomment-226522021","issue_url":"https://api.github.com/repos/jhipster/jhipster-uml/issues/192","id":226522021,"user":{"login":"Paul-Etienne","id":15669805,"avatar_url":"https://avatars.githubusercontent.com/u/15669805?v=3","gravatar_id":"","url":"https://api.github.com/users/Paul-Etienne","html_url":"https://github.com/Paul-Etienne","followers_url":"https://api.github.com/users/Paul-Etienne/followers","following_url":"https://api.github.com/users/Paul-Etienne/following{/other_user}","gists_url":"https://api.github.com/users/Paul-Etienne/gists{/gist_id}","starred_url":"https://api.github.com/users/Paul-Etienne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paul-Etienne/subscriptions","organizations_url":"https://api.github.com/users/Paul-Etienne/orgs","repos_url":"https://api.github.com/users/Paul-Etienne/repos","events_url":"https://api.github.com/users/Paul-Etienne/events{/privacy}","received_events_url":"https://api.github.com/users/Paul-Etienne/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T15:30:58Z","updated_at":"2016-06-16T15:30:58Z","body":"Oh ok, well if you say it's normal.\r\nI'm not sure I understood correctly why this wouldn't work though.\r\nCould you detail a bit more why these two relationships create a circular dependency ?\r\nAlso, before the v1.7.0 is released, how should one do to get these relationships working ? Create one relationship first and then the other one ?"}}
{"actor":{"display_login":"Paul-Etienne"}}