@@ -81,12 +81,11 @@ public String getType() {
81
81
}
82
82
83
83
/**
84
- * In postgresql, the index type (Btree, GIST, etc.) is indicated
85
- * with a USING clause.
86
- * Please note that:
87
- * Oracle - the type might be BITMAP, indicating a bitmap kind of index
88
- * MySQL - the type might be FULLTEXT or SPATIAL
89
- * @param using
84
+ * In postgresql, the index type (Btree, GIST, etc.) is indicated with a USING clause. Please
85
+ * note that: Oracle - the type might be BITMAP, indicating a bitmap kind of index MySQL - the
86
+ * type might be FULLTEXT or SPATIAL
87
+ *
88
+ * @param using
90
89
*/
91
90
public void setUsing (String using ) {
92
91
this .using = using ;
@@ -135,8 +134,15 @@ public Index withIndexSpec(List<String> idxSpec) {
135
134
@ Override
136
135
public String toString () {
137
136
String idxSpecText = PlainSelect .getStringList (idxSpec , false , false );
138
- return ( type !=null ? type : "" ) + (!name .isEmpty () ? " " + getName () : "" ) + " " + PlainSelect .
139
- getStringList (columns , true , true ) + (!"" .equals (idxSpecText ) ? " " + idxSpecText : "" );
137
+ String head = (type != null ? type : "" ) + (!name .isEmpty () ? " " + getName () : "" );
138
+ String tail = PlainSelect .getStringList (columns , true , true )
139
+ + (!"" .equals (idxSpecText ) ? " " + idxSpecText : "" );
140
+
141
+ if ("" .equals (tail )) {
142
+ return head ;
143
+ }
144
+
145
+ return head + " " + tail ;
140
146
}
141
147
142
148
public Index withType (String type ) {
0 commit comments