I have GlassFish set up to use "JDBCRealm". The configuration looks like this and it works fine:
<JDBCRealm userTable="users" userNameCol="user_name"
userCredCol="user_pass" userRoleTable="user_roles"
roleNameCol="role_name" ... />
My database currently looks like this:
- USERS -
USER_NAME | USER_PASS
steve | password1
- USER_ROLES -
USER_NAME | ROLE_NAME
steve | ADMIN
My question is, if I want to normalize the data in the database, how do I configure a realm that can understand the new database design? Do I have to write a custom "realm" object or something like that?
Instead, I want my database to look something this:
- USERS -
USER_ID | USER_NAME | USER_PASS
1 | steve | password1
- ROLES -
ROLE_ID | ROLE_NAME
2 | ADMIN
- USER_ROLES -
USER_ID | ROLE_ID
1 | 2
Any help is greatly appreciated!