|
1 | 1 | package com.codingapi.simplemybatis.parser;
|
2 | 2 |
|
3 |
| -import com.codingapi.simplemybatis.properties.DbProperties.ColumnNameStyle; |
4 |
| -import com.codingapi.simplemybatis.properties.GlabelProperties; |
| 3 | +import com.codingapi.simplemybatis.properties.SimpleMybatisProperties.ColumnNameStyle; |
| 4 | +import com.codingapi.simplemybatis.properties.SimpleMybatisPropertiesContext; |
5 | 5 | import com.codingapi.simplemybatis.utils.StringCharacterUtils;
|
6 | 6 | import org.apache.commons.beanutils.PropertyUtils;
|
7 | 7 | import org.apache.commons.lang3.StringUtils;
|
@@ -36,15 +36,16 @@ public class TableParser {
|
36 | 36 |
|
37 | 37 | public TableParser(Class<?> clazz) {
|
38 | 38 | this.clazz = clazz;
|
39 |
| - columnNameStyle = GlabelProperties.getInstance().getColumnNameStyle(); |
| 39 | + columnNameStyle = SimpleMybatisPropertiesContext.getInstance().getColumnNameStyle(); |
40 | 40 | propertyDescriptors = PropertyUtils.getPropertyDescriptors(clazz);
|
41 | 41 | columns = new ArrayList<>();
|
42 | 42 | loadTableName();
|
43 | 43 | }
|
44 | 44 |
|
45 | 45 |
|
46 |
| - public void parser(Object obj) throws IllegalAccessException, InvocationTargetException { |
| 46 | + public TableInfo parser(Object obj) throws IllegalAccessException, InvocationTargetException { |
47 | 47 | loadColumnNames(obj);
|
| 48 | + return new TableInfo(tableName, idColumn, columns); |
48 | 49 | }
|
49 | 50 |
|
50 | 51 | private void loadColumnNames(Object obj) throws IllegalAccessException, InvocationTargetException {
|
@@ -138,9 +139,6 @@ private String getColumnStyleName(String name) {
|
138 | 139 | }
|
139 | 140 | }
|
140 | 141 |
|
141 |
| - public TableInfo getTableInfo() { |
142 |
| - return new TableInfo(tableName, idColumn, columns); |
143 |
| - } |
144 | 142 |
|
145 | 143 |
|
146 | 144 | public static class ColumnFiled {
|
|
0 commit comments