solomax commented on code in PR #149:
URL: https://github.com/apache/openjpa/pull/149#discussion_r3345726816


##########
openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java:
##########
@@ -918,40 +918,56 @@ private int toForeignKeyAction(ForeignKeyAction action) {
      * Parse the given index.
      */
     private void parseIndex(MappingInfo info, Index idx) {
-        parseIndex(info, idx.name(), idx.enabled(), idx.unique());
+    parseIndex(info, idx.name(), idx.enabled(), idx.unique(), 
idx.columnNames());
     }
 
     /**
      * Set index data on the given mapping info.
      */
     protected void parseIndex(MappingInfo info, String name,
-        boolean enabled, boolean unique) {
+            boolean enabled, boolean unique) {
+        parseIndex(info, name, enabled, unique, null);
+    }
+
+    /**
+     * Set index data on the given mapping info, including optional explicit 
column names.
+     */
+    protected void parseIndex(MappingInfo info, String name,
+            boolean enabled, boolean unique, String[] columnNames) {
         if (!enabled) {
             info.setCanIndex(false);
             return;
         }
 
         org.apache.openjpa.jdbc.schema.Index idx =
-            new org.apache.openjpa.jdbc.schema.Index();
+                new org.apache.openjpa.jdbc.schema.Index();
         if (!StringUtil.isEmpty(name))
             idx.setIdentifier(DBIdentifier.newConstraint(name, delimit()));
         idx.setUnique(unique);
+
+        if (columnNames != null) for (String columnName : columnNames) {

Review Comment:
   ```suggestion
           if (columnNames != null) {
               for (String columnName : columnNames) {
   ```
   
   could you please change this `if-for` to have block for `if` with curly 
braces? (IMO it will be more readable)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to