mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
fixed: 修复 Table.camelToUnderline 在 apt 上配置不生效的问题
This commit is contained in:
parent
06c756d861
commit
f64ff59aab
@ -188,7 +188,7 @@ public class QueryEntityProcessor extends AbstractProcessor {
|
|||||||
|
|
||||||
TypeElement classElement = (TypeElement) entityClassElement;
|
TypeElement classElement = (TypeElement) entityClassElement;
|
||||||
do {
|
do {
|
||||||
fillPropertyAndColumns(propertyAndColumns, defaultColumns, classElement);
|
fillPropertyAndColumns(propertyAndColumns, defaultColumns, classElement, (table == null || table.camelToUnderline()));
|
||||||
classElement = (TypeElement) typeUtils.asElement(classElement.getSuperclass());
|
classElement = (TypeElement) typeUtils.asElement(classElement.getSuperclass());
|
||||||
} while (classElement != null);
|
} while (classElement != null);
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ public class QueryEntityProcessor extends AbstractProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void fillPropertyAndColumns(Map<String, String> propertyAndColumns, List<String> defaultColumns, TypeElement classElement) {
|
private void fillPropertyAndColumns(Map<String, String> propertyAndColumns, List<String> defaultColumns, TypeElement classElement, boolean camelToUnderline) {
|
||||||
for (Element fieldElement : classElement.getEnclosedElements()) {
|
for (Element fieldElement : classElement.getEnclosedElements()) {
|
||||||
|
|
||||||
//all fields
|
//all fields
|
||||||
@ -286,7 +286,8 @@ public class QueryEntityProcessor extends AbstractProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String columnName = column != null && column.value().trim().length() > 0 ? column.value() : camelToUnderline(fieldElement.toString());
|
String columnName = column != null && column.value().trim().length() > 0 ? column.value() :
|
||||||
|
(camelToUnderline ? camelToUnderline(fieldElement.toString()) : fieldElement.toString());
|
||||||
propertyAndColumns.put(fieldElement.toString(), columnName);
|
propertyAndColumns.put(fieldElement.toString(), columnName);
|
||||||
|
|
||||||
if (column == null || (!column.isLarge() && !column.isLogicDelete())) {
|
if (column == null || (!column.isLarge() && !column.isLogicDelete())) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user