0

I need help with the architecture of my classes. I am developing a system with several different actors and I put the common attributes in a parent class and extended the others from it. So I have ADMIN, CLIENT, MANAGER all extending from USER. I could not think of a smart way to do Hibernate mapping. I need to access a table with all the users. Should it be a table for each entity?

Also, if I have a Service for each class, would it be wise to have AdminService, ClientService, etc extend from UserService? How do I do that?

I am using the following architecture: Controllers Service Domain Repository

Project is in Spring boot, Java

2
  • 1
    can you put like an ERD and some code for us? It's a bit hard wrapping mind around what you asking for. Commented Feb 11, 2019 at 14:45
  • 1
    thiis thoughts-on-java.org/… might help you. Commented Feb 18, 2019 at 12:14

1 Answer 1

1

Just like kamlesh commented, on https://thoughts-on-java.org/complete-guide-inheritance-strategies-jpa-hibernate/ you will find all standard approaches. Problem is not new and well supported by Hibernate

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. This is all I needed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.