java - change User entity(I think root entity) In a Jmix project - Stack Overflow

admin2025-04-25  2

When I creating a Jmix project it is automatically creating data model with USER entity. when we customizing our Jmix project can we remove or change the user entity to what ever we want for example to 'Customer' entity?

When I creating a Jmix project it is automatically creating data model with USER entity. when we customizing our Jmix project can we remove or change the user entity to what ever we want for example to 'Customer' entity?

Share Improve this question asked Jan 15 at 6:37 KrishanthaKrishantha 111 bronze badge 3
  • Is your goal to just rename the entity or to enhance it with some features specific to a Customer? Customer sounds like a more specific entity, feels like it can extend the user, but not substitute it. Please consider sharing the code and clarify your requirements. – lopushen Commented Jan 15 at 10:37
  • Please provide enough code so others can better understand or reproduce the problem. – lopushen Commented Jan 15 at 10:37
  • Customer is a any Entity for example we can get Cutomer-Order as Entities and relationship. I do not think I can attached the project here. It's a normal Entity Detail view Project. I am new to JMIX and I would like to know this User entity can be removed or rename? – Krishantha Commented Jan 16 at 14:34
Add a comment  | 

1 Answer 1

Reset to default 0

The User entity is generated in a new Jmix project to provide user authentication and authorization right from the start.

You can change the entity, for example to add or remove some attributes, but be careful with username and password attributes because they implement the org.springframework.security.core.userdetails.UserDetails interface and are used in the authentication process. The Jmix Tutorial contains an example of adding attributes to the User entity.

You can rename the User entity and the corresponding table, but then you need to adjust the Liquibase changelog and the User list and detail views.

The User entity can also be removed if you reconfigure your project for an external authentication through OIDC or LDAP, or if you don't need the authentication at all.

转载请注明原文地址:http://anycun.com/QandA/1745596458a90958.html