I am writing a small training tool.
The main goal is to understand how to work with persistent data without using ORM tools.
So, there is a small database with tables:
users(id, login, password, group_id)
groups(id, name, description)
roles(id, name, description)
groupsroles(group_id, role_id)
So, I applied the DAO template with three objects: User, Role, Group.
The question is: what is the best way to implement relationships? How to use the same connection between UserDAO, GroupDAO, RoleDAO to use database transactions?
source
share