Browse Source

解决实体类没有设置主键会删除表里面所有数据

zhangweixin 4 years ago
parent
commit
6b1806435f

+ 5 - 3
gradle.properties

@@ -25,8 +25,8 @@
 #
 
 PERSAGY_URL = http://www.persagy.com
-PERSAGY_KOTLIN_VERSION = 1.4.115
-PERSAGY_SERVICE_VERSION = 1.4.155
+PERSAGY_KOTLIN_VERSION = 1.4.120
+PERSAGY_SERVICE_VERSION = 1.4.162
 
 MAVEN_REPO_PUBLIC_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-public/
 MAVEN_REPO_RELEASE_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-releases/
@@ -79,4 +79,6 @@ SPRING_CLOUD_DEPENDENCIES = Finchley.RELEASE
 GRADLE_SSH_VERSION = 2.9.0
 
 # https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui
-SPRING_DOC_VERSION = 1.4.8
+SPRING_DOC_VERSION = 1.4.8
+
+LOF4J_VERSION = 1.3.8.RELEASE

+ 0 - 3
persagy-service-base/src/main/kotlin/com/persagy/service/SBaseService.kt

@@ -441,7 +441,6 @@ open class SBaseService<ENTITY: Any> {
             // 如果为1对1,直接取对象类型
             cascadeField.type
         }
-
         val idList = entityIdList(entityMap)
         val relationList = baseDao.relationQuery(cascadeAnno.table, cascadeAnno.idColumn, cascadeAnno.childIdColumn, cascadeAnno.self, cascadeAnno.filter, idList)
         // 如果未取到关联数据,则开始取下一个关联对象
@@ -456,7 +455,6 @@ open class SBaseService<ENTITY: Any> {
         val service = SBaseService(cascadeClass)
         val sqlBuilder = service.select(cascade.filters)
         sqlBuilder.filter(SFilter.inList(cascadeClass.keyFieldList()[0].name, relationMap.keys.toList()))
-
         /** 排序条件 */
         if (null != cascade.orders) {
             sqlBuilder.order(cascade.orders!!)
@@ -509,7 +507,6 @@ open class SBaseService<ENTITY: Any> {
                 }
             }
         }
-
         /** 如果需要进行级联查询 */
         if (cascade.cascade != null && cascade.cascade!!.size > 0 &&
                 childrenList.size > 0) {

+ 2 - 0
persagy-service-mybatis/build.gradle

@@ -47,6 +47,8 @@ dependencies {
     //compile group: 'com.alibaba', name: 'druid', version: DRUID_VERSION
     // https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter
     compile group: 'com.alibaba', name: 'druid-spring-boot-starter', version: SPRING_DRUID_VERSION
+    // druid依赖的包
+//    compile group: 'org.springframework.boot', name: 'spring-boot-starter-log4j', version: LOF4J_VERSION
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // MyBatis支持