Skip to content

'userDetails' at relationship 'user' but no back-reference was found #29413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
ken4ward opened this issue May 6, 2025 · 5 comments
Open
3 tasks

'userDetails' at relationship 'user' but no back-reference was found #29413

ken4ward opened this issue May 6, 2025 · 5 comments

Comments

@ken4ward
Copy link

ken4ward commented May 6, 2025

Overview of the issue

I encountered a warning when defining a one-to-one relationship between UserDetails and the built-in User entity in JHipster. The warning states:

WARNING! Ignoring 'UserDetails' definitions as it is using a built-in Entity 'user': 'otherEntityRelationshipName' is set with value 'userDetails' at relationship 'user' but no back-reference was found

Despite various attempts to adjust the relationship structure, the issue persists.

JHipster JDL
JDL definitions
Examples of relationships I have tried
relationship OneToOne {
  UserDetails to User with builtInEntity
}
relationship OneToOne {
 UserDetails{user(login) required} to User with builtInEntity
}
none worked

entity UserDetails {
id UUID,
firstName String required,
lastName String required,
gender Gender required,
country String,
dateOfBirth LocalDate,
createdAt Instant required,
updatedAt Instant required
}

  • JDL is mandatory for bug reports. This will allow us to use automated tests and generate the broken sample using jhipster from-issue command.
Motivation for or Use Case

This issue prevents proper association of additional user details with the built-in User entity, limiting customization and extension.

Reproduce the error
  1. Define the UserDetails entity.
  2. Create a one-to-one relationship with the built-in User entity.
  3. Run JHipster generation.
  4. Observe the warning about missing back-reference.
Related issues
Suggest a Fix

Potential solutions attempted:

  • Explicitly adding {user} to UserDetails
  • Removing {user} binding
  • Checking JHipster version compatibility
  • Reviewing GitHub discussions and similar reports
JHipster Version(s)

8.10.0

Browsers and Operating System
  • Tickets opened without reproduction steps or that don't follow the template recommendation will be closed.
  • Checking this box is mandatory (this is just to show you read everything)

@ken4ward
Copy link
Author

ken4ward commented May 6, 2025

@jkutner @mraible @jdigger please any help to resolve this issue? Thank you very much all. Jhipster is a ground breaking genius product.

@mshima
Copy link
Member

mshima commented May 6, 2025

We don’t have support to relationships on the User side implemented.
One To One relationships require bidirectional relationship, which is not supported on User side.
That’s the reason for the warning.

@ken4ward
Copy link
Author

ken4ward commented May 7, 2025

@mshima would you please give a sample code that should work in my case. Thank you.

@mshima
Copy link
Member

mshima commented May 7, 2025

@ken4ward something is broken?
The feature is missing that’s the reason for the warning.
To avoid the warning you can convert to a ManyToOne relationship.

@ken4ward
Copy link
Author

ken4ward commented May 7, 2025

@mshima Is it just a warning or it truly impacts the relationship as suggested by the warning log? I have used ManyToOne and it worked without the warning. However using it implies there'll be multiple records of userdetails per user. Thanks a lot for your quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants