From a5d7837c7d66f9bfe0bcda70ebe8ffab76f48194 Mon Sep 17 00:00:00 2001 From: Braydon Date: Sat, 16 Dec 2023 18:27:27 -0500 Subject: [PATCH] oops, forgot to check for @Field --- src/main/java/me/braydon/feather/database/Repository.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/braydon/feather/database/Repository.java b/src/main/java/me/braydon/feather/database/Repository.java index beeb90c..4307ae7 100644 --- a/src/main/java/me/braydon/feather/database/Repository.java +++ b/src/main/java/me/braydon/feather/database/Repository.java @@ -120,8 +120,12 @@ public abstract class Repository, ID, E> { Constructor constructor = entityClass.getConstructor(); // Get the no args constructor E entity = constructor.newInstance(); // Create the entity - // Get the field tagged with @Id + // Get the field tagged with @Field for (Field field : entityClass.getDeclaredFields()) { + // Not the field we're looking for + if (!field.isAnnotationPresent(me.braydon.feather.annotation.Field.class)) { + continue; + } String key = FieldUtils.extractKey(field); // The key of the database field Class type = field.getType(); // The type of the field Object value = mappedData.get(key); // The value of the field