Design database model that represents store. There should be following tables:
- category: id, title, description. Categories should have unique titles.
- property: id, name, value. Properties should have unique name-value pair.
- item: id, title, description, price. Items should have unique titles.
- catalog: id, name. Catalog should have unique names.
Update JDBC Storage classes.
- Create implementations of RowMapper interface for all entities (Catalog, Category, Item, Property).
- Implement all method of JdbcTemplate class. For more details please read javadocs. Each executed sql statement must be logged with debug level.
- Create storages for all entities (Catalog, Category, Item, Property) using JdbcTemplate.
- each storage should implement Storage interface from storage module;
- all entities should contain all sub-entities (catalog should contain all items, items - should contain properties, etc);
- saving, updating, deleting any entities must not be cascaded. Only relations between entities should be modified. E.g. you should prevent saving new items while saving catalog only relations between items and catalogs should be added.
- be sure that multiple modifying operations (e.g. deleting/updating entities with relations) are executed inside the transaction
Update store module to use jdbc-storage instead of in-memory-storage.
- Include latest H2, jdbc-storage dependencies.
- Update Runner class to create StoreApp based on h2 jdbc storage.
- Add examples that demonstrates update, delete, find by id operations.
This task is connected with: