Skip to content

Dev #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 31, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
忽略没有PropertyDescriptor的字段
  • Loading branch information
xinpaisoft committed Apr 29, 2020
commit dc9b134cff830043d598fc6d69e05fc65da20c44
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public void parser(Object obj) throws IllegalAccessException, InvocationTargetEx
private void loadColumnNames(Object obj) throws IllegalAccessException, InvocationTargetException {
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if(field.isSynthetic()){
Method method = getFieldMethod(field);
if(method==null||field.isSynthetic()){
continue;
}
Transient transientField = field.getAnnotation(Transient.class);
Expand All @@ -61,7 +62,6 @@ private void loadColumnNames(Object obj) throws IllegalAccessException, Invocati
Id id = field.getAnnotation(Id.class);
if (id != null) {
String idColumnName = getColumnName(field.getAnnotation(Column.class), field);
Method method = getFieldMethod(field);
Object idValue = getFieldValue(method, obj);
String fieldName = field.getName();
idColumn = new ColumnFiled(fieldName, idColumnName, idValue, method);
Expand All @@ -70,7 +70,6 @@ private void loadColumnNames(Object obj) throws IllegalAccessException, Invocati
}
Column column = field.getAnnotation(Column.class);
String columnName = getColumnName(column, field);
Method method = getFieldMethod(field);
Object value = getFieldValue(method, obj);
columns.add(new ColumnFiled(field.getName(), columnName, value, method));
}
Expand Down