You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
relationship OneToOne is not Working as unidirectional #33264
relationship OneToOne {
Order{recipient} to Member
Order{publisher} to Member
}
to create following Class Contains
class Order {
private Member recipient;
private Member publisher;
-- more Attributes ---
}
For
class Member
not Relation to Order
if I execute my IDL creation
jhipster import-jdl jhipster-jdl.jh
I getting following Error Message
ERROR! An error occured while running jhipster:base-application:bootstrap#checkProperties
ERROR! ERROR! You have duplicate properties in entity Member: order
Error: You have duplicate properties in entity Member: order
On the Webpage
JHipster Domain Language (JDL) - Relationships
I think it must work
Unidirectional or bidirectional relationships?
Depending on how you design your models, you may want unidirectional relationships instead of bidirectional ones. This is achieved by not specifying an injected field like this:
relationship OneToOne {
A{a} to B
}
You can also not specify them, and at least one will be injected by default (the source)
relationship OneToOne {
A to B
}
If I use this relationship
OneToOne {
Order{recipient} to Member
}
I get following Error Message
ERROR! An error occured while running jhipster:base-application:bootstrap#checkProperties
ERROR! ERROR! You have duplicate properties in entity Order: recipient
Error: You have duplicate properties in entity Order: recipient
at BootstrapBaseApplicationGenerator.checkProperties (file:///opt/homebrew/lib/node_modules/generator-jhipster/dist/generators/base-application/generators/bootstrap/generator.js:413:31)
See #25901.
The linked PR won’t fix the issue. It will only workaround the current behavior. It generates tables which can change on incremental changes.
The fix would involve using join tables instead of back reference relationship.
Activity
Gonare-22 commentedon May 3, 2026
Hi, I’d like to work on this issue. I’m currently reproducing the problem locally and investigating the relationship generation flow.
mshima commentedon May 3, 2026
See #25901.
The linked PR won’t fix the issue. It will only workaround the current behavior. It generates tables which can change on incremental changes.
The fix would involve using join tables instead of back reference relationship.