소스 검색

初始

master
郑根木 2 년 전
부모
커밋
1a3d0ad7ab
3개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. +3
    -2
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/cache/EntityCache.java
  2. +1
    -0
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/dao/AbstractEntityDao.java
  3. +5
    -1
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/DefaultListHandler.java

+ 3
- 2
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/cache/EntityCache.java 파일 보기

@@ -2,6 +2,7 @@ package cc.smtweb.framework.core.db.cache;

import cc.smtweb.framework.core.annotation.SwCache;
import cc.smtweb.framework.core.cache.AbstractCache;
import cc.smtweb.framework.core.common.SwConsts;
import cc.smtweb.framework.core.db.DbEngine;
import cc.smtweb.framework.core.db.EntityDao;
import cc.smtweb.framework.core.db.impl.DefaultEntity;
@@ -38,10 +39,10 @@ public class EntityCache extends AbstractCache<DefaultEntity> {
String ret = "";
for (String s : StringUtils.split(cache.getFields(), ",")) {
if (StringUtils.isNotEmpty(s)) {
ret += "_" + bean.getStr(s);
ret += SwConsts.SPLIT_CHAR + bean.getStr(s);
}
}
return ret;
return ret.substring(1);
};
if (cache.isMapType()) {
regMap(cache.getName(), key);


+ 1
- 0
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/dao/AbstractEntityDao.java 파일 보기

@@ -313,6 +313,7 @@ public abstract class AbstractEntityDao<T> {
}

public Object readValue(T obj, String fieldName) {
if (obj == null) return null;
EntityColumn beanColumn = getBeanColumn(fieldName);

return beanColumn.readValue(obj);


+ 5
- 1
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/DefaultListHandler.java 파일 보기

@@ -91,7 +91,11 @@ public class DefaultListHandler<T extends DefaultEntity> extends AbstractListHan
String sn = (String) dao.readValue(b, l.getLinkNameField());
if (StringUtils.isNotEmpty(sn)) names += "," + sn;
}
row.put(l.getFieldName() + "_text", names.substring(1));
if (StringUtils.isNotEmpty(names)) {
row.put(l.getFieldName() + "_text", names.substring(1));
} else {
row.put(l.getFieldName() + "_text", "");
}
} else {
List<String> list = mapIds.computeIfAbsent(l.getLinkTable().getName(), k -> new ArrayList<>());
Collections.addAll(list, ids);


불러오는 중...
취소
저장