{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/jhipster-domain-language/issues/8","repository_url":"https://api.github.com/repos/jhipster/jhipster-domain-language","labels_url":"https://api.github.com/repos/jhipster/jhipster-domain-language/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/jhipster-domain-language/issues/8/comments","events_url":"https://api.github.com/repos/jhipster/jhipster-domain-language/issues/8/events","html_url":"https://github.com/jhipster/jhipster-domain-language/issues/8","id":148468151,"number":8,"title":"Creating a required OneToMany in the \"Many\" part.","user":{"login":"marcosmoreno","id":7763263,"avatar_url":"https://avatars.githubusercontent.com/u/7763263?v=3","gravatar_id":"","url":"https://api.github.com/users/marcosmoreno","html_url":"https://github.com/marcosmoreno","followers_url":"https://api.github.com/users/marcosmoreno/followers","following_url":"https://api.github.com/users/marcosmoreno/following{/other_user}","gists_url":"https://api.github.com/users/marcosmoreno/gists{/gist_id}","starred_url":"https://api.github.com/users/marcosmoreno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcosmoreno/subscriptions","organizations_url":"https://api.github.com/users/marcosmoreno/orgs","repos_url":"https://api.github.com/users/marcosmoreno/repos","events_url":"https://api.github.com/users/marcosmoreno/events{/privacy}","received_events_url":"https://api.github.com/users/marcosmoreno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-14T20:06:04Z","updated_at":"2016-04-17T13:13:59Z","closed_at":null,"body":"If I create the example:\r\n\r\n```\r\nentity Owner {}\r\nentity Car {}\r\nrelationship OneToMany {\r\n  Owner{car} to Car{owner}\r\n}\r\n```\r\n\r\nJhipster creates Entities for Owner and Car, and I can create Cars without owner. \r\nIs it possible to specify that the owner is required with JDL?\r\n\r\nIn the Entities annotations, I see that a ManyToOne is created for the Car Entity. I guess I would like that this relationship has (optional=false)  next to the declaration, and that Jhipster automatically cares of the front-end code validation."},"comment":{"url":"https://api.github.com/repos/jhipster/jhipster-domain-language/issues/comments/211014859","html_url":"https://github.com/jhipster/jhipster-domain-language/issues/8#issuecomment-211014859","issue_url":"https://api.github.com/repos/jhipster/jhipster-domain-language/issues/8","id":211014859,"user":{"login":"marcosmoreno","id":7763263,"avatar_url":"https://avatars.githubusercontent.com/u/7763263?v=3","gravatar_id":"","url":"https://api.github.com/users/marcosmoreno","html_url":"https://github.com/marcosmoreno","followers_url":"https://api.github.com/users/marcosmoreno/followers","following_url":"https://api.github.com/users/marcosmoreno/following{/other_user}","gists_url":"https://api.github.com/users/marcosmoreno/gists{/gist_id}","starred_url":"https://api.github.com/users/marcosmoreno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcosmoreno/subscriptions","organizations_url":"https://api.github.com/users/marcosmoreno/orgs","repos_url":"https://api.github.com/users/marcosmoreno/repos","events_url":"https://api.github.com/users/marcosmoreno/events{/privacy}","received_events_url":"https://api.github.com/users/marcosmoreno/received_events","type":"User","site_admin":false},"created_at":"2016-04-17T13:13:59Z","updated_at":"2016-04-17T13:13:59Z","body":"Thank you @MathieuAA . I created the feature request in the generator-jhipster.\r\n\r\nJust some info: when I just add the annotation @NotNull to the @ManyToOne field and try to add a registry to the Car entity without selecting the Owner, jhipster behaves exactly as I wanted, as it tells that the field cannot be empty (jhipster 3.0). \r\n\r\nThis means that jhipster is already taking care of it, at least the bit of inserting with the entities front end. Is then just missing that the jhipster:import-jdl includes the capability of adding the @NotNull to the @ManyToOne annotation when \"something\" is parsed in the JDL? Or might be some unexpected consequences somewhere doing this? "}}