mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-21 08:27:11 +00:00
fix[storage]: record check error
This commit is contained in:
@@ -54,10 +54,6 @@ public abstract class FieldUtils {
|
||||
|
||||
var methodName = "set" + StringUtils.capitalize(fieldName);
|
||||
|
||||
if (clazz.isRecord()) {
|
||||
return methodName;
|
||||
}
|
||||
|
||||
try {
|
||||
clazz.getDeclaredMethod(methodName, field.getType());
|
||||
return methodName;
|
||||
|
||||
@@ -104,6 +104,9 @@ public class StorageManager implements IStorageManager {
|
||||
var allRelevantClass = new HashSet<Class<?>>();
|
||||
resourceDefinitionMap.values().forEach(it -> allRelevantClass.addAll(ClassUtils.relevantClass(it.getClazz())));
|
||||
for (var clazz : allRelevantClass) {
|
||||
if (clazz.isRecord()) {
|
||||
continue;
|
||||
}
|
||||
var fieldList = ReflectionUtils.notStaticAndTransientFields(clazz);
|
||||
for (var field : fieldList) {
|
||||
if (Modifier.isPublic(field.getModifiers())) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.zfoo.storage.manager.StorageManager;
|
||||
import com.zfoo.storage.model.IStorage;
|
||||
import com.zfoo.storage.resource.StudentCsvResource;
|
||||
import com.zfoo.storage.resource.StudentResource;
|
||||
import com.zfoo.storage.resource.TeacherResource;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -54,6 +55,7 @@ public class ApplicationTest {
|
||||
List<StudentResource> list = StorageContext.getList(StudentResource.class);
|
||||
//根据主键获取数据
|
||||
StudentResource studentResource = StorageContext.get(StudentResource.class, 1001);
|
||||
TeacherResource teacherResource = StorageContext.get(TeacherResource.class, 1001);
|
||||
//获取名字索引列表
|
||||
List<StudentResource> nameIndexList = StorageContext.getIndexes(StudentResource.class, StudentResource::getName, "james1");
|
||||
//获取年龄索引列表
|
||||
|
||||
Reference in New Issue
Block a user