File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed
src/main/java/net/sf/jsqlparser
expression/operators/relational Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public ExpressionList withExpressions(T... expressions) {
74
74
return addExpressions (expressions );
75
75
}
76
76
77
- public ExpressionList withExpressions (Collection <T > expressions ) {
77
+ public ExpressionList <?> withExpressions (Collection <T > expressions ) {
78
78
this .clear ();
79
79
return addExpressions (expressions );
80
80
}
Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ public void setColumnName(String string) {
94
94
95
95
@ Override
96
96
public String getFullyQualifiedName () {
97
- return getName (false );
97
+ return getFullyQualifiedName (false );
98
98
}
99
99
100
- public String getName (boolean aliases ) {
100
+ public String getFullyQualifiedName (boolean aliases ) {
101
101
StringBuilder fqn = new StringBuilder ();
102
102
103
103
if (table != null ) {
@@ -121,14 +121,20 @@ public String getName(boolean aliases) {
121
121
return fqn .toString ();
122
122
}
123
123
124
+ // old and confusing, don't use it!
125
+ @ Deprecated
126
+ public String getName (boolean aliases ) {
127
+ return columnName ;
128
+ }
129
+
124
130
@ Override
125
131
public void accept (ExpressionVisitor expressionVisitor ) {
126
132
expressionVisitor .visit (this );
127
133
}
128
134
129
135
@ Override
130
136
public String toString () {
131
- return getName (true );
137
+ return getFullyQualifiedName (true );
132
138
}
133
139
134
140
public Column withTable (Table table ) {
Original file line number Diff line number Diff line change @@ -226,12 +226,21 @@ public String toString() {
226
226
}
227
227
sql .append ("INTO " );
228
228
sql .append (table ).append (" " );
229
+
229
230
if (columns != null ) {
230
- sql .append (PlainSelect .getStringList (columns , true , true )).append (" " );
231
+ sql .append ("(" );
232
+ for (int i = 0 ; i < columns .size (); i ++) {
233
+ if (i > 0 ) {
234
+ sql .append (", " );
235
+ }
236
+ // only plain names, but not fully qualified names allowed
237
+ sql .append (columns .get (i ).getColumnName ());
238
+ }
239
+ sql .append (") " );
231
240
}
232
241
233
242
if (outputClause != null ) {
234
- sql .append (outputClause . toString () );
243
+ sql .append (outputClause );
235
244
}
236
245
237
246
if (select != null ) {
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ public void deParse(Insert insert) {
60
60
buffer .append ("INTO " );
61
61
62
62
buffer .append (insert .getTable ().toString ());
63
-
64
63
if (insert .getColumns () != null ) {
65
64
buffer .append (" (" );
66
65
for (Iterator <Column > iter = insert .getColumns ().iterator (); iter .hasNext ();) {
You can’t perform that action at this time.
0 commit comments