This is the ER schema for the database of Common Expenses application:
The schema itself should be quite self-explaining anyway here are the main points:
- meta_ts and meta_user are logging data they represent date and user of tuple creation.
- OneToMany relationship between Project and Expense
- OneToMany relationship between User and Share
- OneToMany relationship between Expense and Share
- ManyToMany relationship between User and Project, there are a join table (Partecipate) for this relationship which hold also the leader of a project.
I’m going to make Hibernate generate the database form me so I’m quite sure the final schema will be slighty different from the one above.