File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,24 @@ public Select newSelectAlias(String alias) {
109109 table .newAlias (alias ));
110110 }
111111
112+ public Optional <Column > findColumn (String name ) {
113+ Map <String , Column > columnMap = getColumns ();
114+ Column column = columnMap .get (name );
115+
116+ if (column != null ) {
117+ return Optional .of (column );
118+ }
119+
120+ for (Column col : columnList ) {
121+ if (Objects .equals (col .name , name ) || Objects .equals (col .name , QueryHelperUtils .toSnake (name ))) {
122+ return Optional .of (col );
123+ }
124+ }
125+
126+ return Optional .empty ();
127+
128+ }
129+
112130 public Map <String , Column > getColumns () {
113131 return columns == null
114132 ? columns = columnList
You can’t perform that action at this time.
0 commit comments