diff --git a/src/main/java/com/xkrs/model/entity/BankCardEntity.java b/src/main/java/com/xkrs/model/entity/BankCardEntity.java index d1997d3..c44129b 100644 --- a/src/main/java/com/xkrs/model/entity/BankCardEntity.java +++ b/src/main/java/com/xkrs/model/entity/BankCardEntity.java @@ -14,8 +14,8 @@ public class BankCardEntity { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "bank_card_seq_gen") - @SequenceGenerator(name = "bank_card_seq_gen", sequenceName = "bank_card_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "bank_card_seq_gen", sequenceName = "bank_card_id_seq",allocationSize = 1) private Integer id; /** diff --git a/src/main/java/com/xkrs/model/entity/BusinessEntity.java b/src/main/java/com/xkrs/model/entity/BusinessEntity.java index 2d2181e..2f289e2 100644 --- a/src/main/java/com/xkrs/model/entity/BusinessEntity.java +++ b/src/main/java/com/xkrs/model/entity/BusinessEntity.java @@ -14,8 +14,8 @@ public class BusinessEntity { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "business_seq_gen") - @SequenceGenerator(name = "business_seq_gen", sequenceName = "business_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "business_seq_gen", sequenceName = "business_id_seq",allocationSize = 1) private Integer id; /** diff --git a/src/main/java/com/xkrs/model/entity/FileDocumentEntity.java b/src/main/java/com/xkrs/model/entity/FileDocumentEntity.java index 83a8efb..f55722f 100644 --- a/src/main/java/com/xkrs/model/entity/FileDocumentEntity.java +++ b/src/main/java/com/xkrs/model/entity/FileDocumentEntity.java @@ -16,8 +16,8 @@ public class FileDocumentEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "file_document_seq_gen") - @SequenceGenerator(name = "file_document_seq_gen", sequenceName = "file_document_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "file_document_seq_gen", sequenceName = "file_document_seq",allocationSize = 1) private Integer id; @Column(length = 64, nullable = false, columnDefinition = "varchar(64)") diff --git a/src/main/java/com/xkrs/model/entity/ProductContentPhotoEntity.java b/src/main/java/com/xkrs/model/entity/ProductContentPhotoEntity.java index 93b130d..99fb24e 100644 --- a/src/main/java/com/xkrs/model/entity/ProductContentPhotoEntity.java +++ b/src/main/java/com/xkrs/model/entity/ProductContentPhotoEntity.java @@ -13,8 +13,8 @@ public class ProductContentPhotoEntity { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "product_content_photo_seq_gen") - @SequenceGenerator(name = "product_content_photo_seq_gen", sequenceName = "product_content_photo_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "product_content_photo_seq_gen", sequenceName = "product_content_photo_id_seq",allocationSize = 1) private Integer id; /** diff --git a/src/main/java/com/xkrs/model/entity/ProductCoverEntity.java b/src/main/java/com/xkrs/model/entity/ProductCoverEntity.java index 3c4dd35..5181a43 100644 --- a/src/main/java/com/xkrs/model/entity/ProductCoverEntity.java +++ b/src/main/java/com/xkrs/model/entity/ProductCoverEntity.java @@ -13,8 +13,8 @@ public class ProductCoverEntity { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "product_cover_seq_gen") - @SequenceGenerator(name = "product_cover_seq_gen", sequenceName = "product_cover_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "product_cover_seq_gen", sequenceName = "product_cover_id_seq",allocationSize = 1) private Integer id; /** diff --git a/src/main/java/com/xkrs/model/entity/ProductEntity.java b/src/main/java/com/xkrs/model/entity/ProductEntity.java index 14d74d2..fd7b736 100644 --- a/src/main/java/com/xkrs/model/entity/ProductEntity.java +++ b/src/main/java/com/xkrs/model/entity/ProductEntity.java @@ -14,8 +14,8 @@ public class ProductEntity { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "product_seq_gen") - @SequenceGenerator(name = "product_seq_gen", sequenceName = "product_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "product_seq_gen", sequenceName = "product_id_seq",allocationSize = 1) private Integer id; /** diff --git a/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java b/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java index 8b11019..cab7d0e 100644 --- a/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java +++ b/src/main/java/com/xkrs/model/entity/RelRoleAuthorityEntity.java @@ -15,8 +15,8 @@ public class RelRoleAuthorityEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "rel_role_authority_seq_gen") - @SequenceGenerator(name = "rel_role_authority_seq_gen", sequenceName = "rel_role_authority_id_seq") + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "rel_role_authority_seq_gen", sequenceName = "rel_role_authority_id_seq") private Integer id; @Column(nullable = false) diff --git a/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java b/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java index 2d52afe..ee5ad2f 100644 --- a/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java +++ b/src/main/java/com/xkrs/model/entity/RelUserRoleEntity.java @@ -15,8 +15,8 @@ public class RelUserRoleEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "rel_user_role_seq_gen") - @SequenceGenerator(name = "rel_user_role_seq_gen", sequenceName = "rel_user_role_id_seq") + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "rel_user_role_seq_gen", sequenceName = "rel_user_role_id_seq") private Integer id; @Column(nullable = false) diff --git a/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java b/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java index f097f50..d5357bd 100644 --- a/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java +++ b/src/main/java/com/xkrs/model/entity/SysAuthorityEntity.java @@ -15,8 +15,8 @@ public class SysAuthorityEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_authority_seq_gen") - @SequenceGenerator(name = "sys_authority_seq_gen", sequenceName = "sys_authority_id_seq") + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "sys_authority_seq_gen", sequenceName = "sys_authority_id_seq") private Integer id; @Column(length = 64, nullable = false, unique = true,columnDefinition = "varchar(64)") diff --git a/src/main/java/com/xkrs/model/entity/SysRoleEntity.java b/src/main/java/com/xkrs/model/entity/SysRoleEntity.java index 0d30389..ec002bf 100644 --- a/src/main/java/com/xkrs/model/entity/SysRoleEntity.java +++ b/src/main/java/com/xkrs/model/entity/SysRoleEntity.java @@ -15,8 +15,8 @@ public class SysRoleEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_role_seq_gen") - @SequenceGenerator(name = "sys_role_seq_gen", sequenceName = "sys_role_id_seq") + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "sys_role_seq_gen", sequenceName = "sys_role_id_seq") private Integer id; @Column(length = 32, nullable = false, unique = true,columnDefinition = "varchar(32)") diff --git a/src/main/java/com/xkrs/model/entity/SysUserEntity.java b/src/main/java/com/xkrs/model/entity/SysUserEntity.java index f0f28df..9908dc1 100644 --- a/src/main/java/com/xkrs/model/entity/SysUserEntity.java +++ b/src/main/java/com/xkrs/model/entity/SysUserEntity.java @@ -18,8 +18,8 @@ public class SysUserEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_user_seq_gen") - @SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY) + //@SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq",allocationSize = 1) private Integer id; /** diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b4c7ca5..8b3ed0a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,4 @@ -server.port = 6809 +server.port = 6801 ## 数据源配置 spring.datasource.url = jdbc:mysql://rm-bp160630z03x880745o.mysql.rds.aliyuncs.com:3306/leyibo_business?useSSL=false&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&serverTimezone=Asia/Shanghai @@ -27,15 +27,17 @@ spring.datasource.hikari.minimum-idle = 5 spring.datasource.hikari.validation-timeout = 3000 ## Spring Data JPA 配置 -spring.jpa.database = mysql -spring.jpa.database-platform = org.hibernate.dialect.MySQL5Dialect -spring.jpa.show-sql = true -# 指定 ddl mode (none, validate, create, create-drop, update) -spring.jpa.hibernate.ddl-auto = update +#spring.jpa.database = mysql +#spring.jpa.database-platform = org.hibernate.dialect.MySQL5Dialect +#spring.jpa.show-sql = true +## 指定 ddl mode (none, validate, create, create-drop, update) +#spring.jpa.hibernate.ddl-auto = update +spring.jpa.hibernate.hbm2ddl.auto=update +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.show-sql= true +spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true # 命名策略 spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy -#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL95Dialect -#spring.jpa.properties.hibernate.dialect = org.hibernate.spatial.dialect.postgis.PostgisDialect spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false spring.jpa.properties.hibernate.jdbc.batch_size=500