jhipster / generator-jhipster-micronaut

Micronaut blueprint for JHipster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated link to User produces code that doesn't compile

agilob opened this issue · comments

relationship OneToMany {
     Blog{user(login)} to User
}

Will produce code that has setters on blog which uses user.setBlog(this) but user class doesn't have this setter and link in liquibase

Noting that ManyToMany works fine.

I think this is not supported. See https://www.jhipster.tech/managing-relationships/

Only many-to-one to the user and many-to-many or one-to-one where the other entity is the owner are allowed. Not sure if we prevent this in the main generator/jdl level. But for now I will close this as the scenario you describe is not supported. If you want something similar you can create a new intermediate entity (e.g. BlogAuthor) and relate this to the the user via one-to-one and relate the BlogAuthor via OneToMany to the blog.