For my application is have two kinds of users. A Customer and a Retailer. I would like to store them both in the same 'users' table for authentication reasons. But both the Customer and Retailer have same and different values.
They both have a name, password, id... But they also both have different values, the Customer has an address. And the Retailer has a list of products.
I would like to use composition. Like this:
So both the Retailer and Customer have the UserDetails. But they also have their own separate values like address or products.
Would this be a smart way of doing it. Or am i better of having both users in a seperate table?
Also because i'm using Hibernate i need to be able to map my classes to my database. What would be the best way of going about this?