From 370dca27ff6eee3ac2150799c909089e7a5c4ff1 Mon Sep 17 00:00:00 2001 From: DaveBoy1994 Date: Wed, 4 Mar 2020 13:23:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E8=81=94=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=80=BB=E8=BE=91=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/arialyy/aria/orm/DelegateFind.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java b/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java index 1128376f..555f2599 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java @@ -26,6 +26,7 @@ import com.arialyy.aria.util.ALog; import com.arialyy.aria.util.CommonUtil; import java.lang.reflect.Field; import java.net.URLDecoder; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -259,7 +260,9 @@ class DelegateFind extends AbsDelegate { parents.put(pRowId, createParent(pRowId, parentClazz, pColumn, cursor)); } if(paged){ - childs.get(pRowId).addAll(createChildren(db,childClazz,pColumn,entityColumn,parentColumn,parents.get(pRowId))); + List list = createChildren(db, childClazz, pColumn, entityColumn, parentColumn, parents.get(pRowId)); + if(list!=null) + childs.get(pRowId).addAll(list); } else { childs.get(pRowId).add(createChild(childClazz, cColumn, cursor)); @@ -304,6 +307,9 @@ class DelegateFind extends AbsDelegate { field.setAccessible(true); if(field.getName().equals(parentColumn)){ Object o = field.get(parents); + if(o instanceof String) { + o = URLEncoder.encode((String) o); + } return findData(db,childClazz,entityColumn+"='"+o+"'"); } }