springboot项目--数据库配置(使用JpaRepository进行增删改查)(1)

CREATE TABLE product_category (

category_idint not null AUTO_INCREMENT,

category_name varchar(64)not null comment’类目名字’,

category_type decimal(8,2)not null comment’类目编号’,

create_time timestamp not null default current_timestamp comment’创建时间’,

update_time timestamp not null default current_timestamp on update current_timestamp

comment’修改时间’,

PRIMARY KEY (category_id),

UNIQUE KEY une_category_type (category_type)

)comment’商品表’;

下图红色圈出来就是刚才新建的表。

springboot项目--数据库配置(使用JpaRepository进行增删改查)(1)_第1张图片

3.在spring项目的pom.xml里添加以下依赖:


mysql

mysql-connector-java

org.springframework.boot

spring-boot-starter-data-jpa

4.在reso

你可能感兴趣的:(程序员,spring,boot,数据库,后端)