- Download and install H2 database
- Create database
store
- Create user
store_user
with any password - Include gradle dependency for H2 JDBC driver
Design database model that represents store. There should be following tables:
- category: id, title, description
- property: name, value. Please be sure that there is no way to create 2 properties with the same name and value.
- item: id, title, description, price
- catalog: id, name
Create relations between tables.
- One item should contain many properties. Many items may contain the same properties.
- One item should be related to many categories. Many items may be related to many categories.
- One item may be related to many catalogs. One catalog may contains many items.
Create demo class, that creates:
- Several items.
- Several categories.
- Several catalogs.
- Several properties.
- Link items to catalogs, categories, properties.
- Retrieve information about all catalogs, with all items in this catalog. Note that properties and categories of all items should be filled in.
NOTE: All SQL statements for user, schema creation should be in the resource
folder as SQL file. Also feel free to extend or modify models with any additional methods and fields if needed.