GithubHelp home page GithubHelp logo

jdbc.pr1's Introduction

JDBC. Practice Task 1

1 SQL Schema design

Design database model that represents store. There should be following tables:

  1. category: id, title, description. Categories should have unique titles.
  2. property: id, name, value. Properties should have unique name-value pair.
  3. item: id, title, description, price. Items should have unique titles.
  4. catalog: id, name. Catalog should have unique names.

2 JDBC Storage

Update JDBC Storage classes.

  1. Create implementations of RowMapper interface for all entities (Catalog, Category, Item, Property).
  2. Implement all method of JdbcTemplate class. For more details please read javadocs. Each executed sql statement must be logged with debug level.
  3. 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

3 Store

Update store module to use jdbc-storage instead of in-memory-storage.

  1. Include latest H2, jdbc-storage dependencies.
  2. Update Runner class to create StoreApp based on h2 jdbc storage.
  3. Add examples that demonstrates update, delete, find by id operations.

jdbc.pr1's People

Contributors

xsavikx avatar didva avatar gitter-badger avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.