oops, forgot to check for @Field
This commit is contained in:
parent
06a716dc00
commit
a5d7837c7d
@ -120,8 +120,12 @@ public abstract class Repository<D extends IDatabase<?, ?>, ID, E> {
|
|||||||
Constructor<? extends E> constructor = entityClass.getConstructor(); // Get the no args constructor
|
Constructor<? extends E> constructor = entityClass.getConstructor(); // Get the no args constructor
|
||||||
E entity = constructor.newInstance(); // Create the entity
|
E entity = constructor.newInstance(); // Create the entity
|
||||||
|
|
||||||
// Get the field tagged with @Id
|
// Get the field tagged with @Field
|
||||||
for (Field field : entityClass.getDeclaredFields()) {
|
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
|
String key = FieldUtils.extractKey(field); // The key of the database field
|
||||||
Class<?> type = field.getType(); // The type of the field
|
Class<?> type = field.getType(); // The type of the field
|
||||||
Object value = mappedData.get(key); // The value of the field
|
Object value = mappedData.get(key); // The value of the field
|
||||||
|
Loading…
Reference in New Issue
Block a user