# Spring-Boot Demo **Repository Path**: wzyjerry/Spring-Boot-Demo ## Basic Information - **Project Name**: Spring-Boot Demo - **Description**: A demo project for spring-boot - **Primary Language**: Java - **License**: BSD-2-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-10-21 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Spring-Boot Demo ## Description + A demo project for spring-boot. + Using MySQL and JPA to implement basic CURD and Page method for a simple entity **Value**, which contains only three columns: ID, key and value. ## Environment + JDK 1.8 + MySQL + Spring-Boot 1.5.7 + Bootstrap 3 ## Framework ### Dictionary Structure #### java + controller: @Controller, define router, accept viewModel, check values, call service, return result, etc. default router: /{controller}/{action}/{id} controller=home, action=index, id={optional} + service: Business logic layer, accept data, return data. + serviceImpl: @Service, implement services, should be unit test. + repository: Interface of data, extend JpaRepository + model: @Entity, store entity POJO classes + viewModel: Define forms and form validation + exception: Define custom exceptions + SpringBootDemoApplication.java: Entrance of the project #### resources + static: Store static files such as css, js and img. Shared resources storage into shared, recommended naming as (controller/action) + templates: Thymeleaf template, shared/layout.html is master page, recommended naming as (controller/method) + application.yml: YAML formatted application setting. ### Framework content + Connect MySQL database, using user root, password root, auto build database springBootDemo. The definition of the database is in file springBootDemo.sql. + Define sample POJO class **Value**, which contains primary key **id**, key and value, if table not exist, JPA will create it. + Define business logic, here business logic are directly CURD and Page method, and default setting of page method is 10 records per page. + Define controllers and basic pages for List, Create, Update, Retrieve and Delete.