|
|
@ -17,6 +17,7 @@ package com.arialyy.aria.orm; |
|
|
|
|
|
|
|
|
|
|
|
import android.database.sqlite.SQLiteDatabase; |
|
|
|
import android.database.sqlite.SQLiteDatabase; |
|
|
|
import android.text.TextUtils; |
|
|
|
import android.text.TextUtils; |
|
|
|
|
|
|
|
import android.util.Log; |
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.lang.reflect.Modifier; |
|
|
|
import java.lang.reflect.Modifier; |
|
|
@ -91,11 +92,11 @@ final class SqlUtil { |
|
|
|
throw new IllegalArgumentException("List中元素必须被@NormalList注解"); |
|
|
|
throw new IllegalArgumentException("List中元素必须被@NormalList注解"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (TextUtils.isEmpty(str)) return null; |
|
|
|
if (TextUtils.isEmpty(str)) return null; |
|
|
|
String[] datas = str.split("$$"); |
|
|
|
String[] datas = str.split("\\$\\$"); |
|
|
|
List list = new ArrayList(); |
|
|
|
List list = new ArrayList(); |
|
|
|
String type = normalList.clazz().getName(); |
|
|
|
String type = normalList.clazz().getName(); |
|
|
|
for (String data : datas) { |
|
|
|
for (String data : datas) { |
|
|
|
list.add(checkData(data, type)); |
|
|
|
list.add(checkData(type, data)); |
|
|
|
} |
|
|
|
} |
|
|
|
return list; |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
@ -176,17 +177,13 @@ final class SqlUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static Object checkData(String type, String data) { |
|
|
|
private static Object checkData(String type, String data) { |
|
|
|
switch (type) { |
|
|
|
if (type.equalsIgnoreCase("java.lang.String")){ |
|
|
|
case "String": |
|
|
|
|
|
|
|
return data; |
|
|
|
return data; |
|
|
|
case "int": |
|
|
|
}else if (type.equalsIgnoreCase("int") || type.equals("java.lang.Integer")){ |
|
|
|
case "Integer": |
|
|
|
|
|
|
|
return Integer.parseInt(data); |
|
|
|
return Integer.parseInt(data); |
|
|
|
case "double": |
|
|
|
}else if (type.equalsIgnoreCase("double") || type.equals("java.lang.Double")){ |
|
|
|
case "Double": |
|
|
|
|
|
|
|
return Double.parseDouble(data); |
|
|
|
return Double.parseDouble(data); |
|
|
|
case "float": |
|
|
|
}else if (type.equalsIgnoreCase("float") || type.equals("java.lang.Float")){ |
|
|
|
case "Float": |
|
|
|
|
|
|
|
return Float.parseFloat(data); |
|
|
|
return Float.parseFloat(data); |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|