cwegener-79 commented on code in PR #149:
URL: https://github.com/apache/openjpa/pull/149#discussion_r3346939440
##########
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:
You’re right, using curly braces makes it more readable.
I’ve removed the whitespace-only changes in
AnnotationPersistenceMappingParser, restored the accidental indentation
changes. By the way I updated my commit signature as well. Now it's signed and
verified. :-)
Please let me know if there’s anything else I can do for this fix.
--
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]