X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=music-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Fdatastore%2Fjsonobjects%2FJsonTable.java;h=0ba1a7ef8b96bedbfc12370c67efe30700018569;hb=1aafd3ff1cbf1827ded174efd2659539b7f80dac;hp=0a277e087caf3fd211fc0c7218ac507a9cce8838;hpb=d4f4d573469aaa9b284313e4bd9535e6d8e3dd10;p=music.git diff --git a/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonTable.java b/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonTable.java index 0a277e08..0ba1a7ef 100644 --- a/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonTable.java +++ b/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonTable.java @@ -166,8 +166,10 @@ public class JsonTable { if (entry.getKey().equals("PRIMARY KEY")) { primaryKey = entry.getValue(); // replaces primaryKey primaryKey = primaryKey.trim(); - } else { - if (counter == 0 ) fieldsString.append("" + entry.getKey() + " " + entry.getValue() + ""); + } + else { + if (counter == 0 ) + fieldsString.append("" + entry.getKey() + " " + entry.getValue() + ""); else fieldsString.append("," + entry.getKey() + " " + entry.getValue() + ""); } @@ -209,7 +211,8 @@ public class JsonTable { clusterKey=clusterKey.substring(1); } clusterKey = clusterKey.trim(); - if (clusterKey.equals(",") ) clusterKey=""; // print error if needed ( ... ),) + if (clusterKey.equals(",") ) + clusterKey=""; // print error if needed ( ... ),) } if (!(partitionKey.isEmpty() || clusterKey.isEmpty()) @@ -226,12 +229,16 @@ public class JsonTable { } - if (partitionKey.isEmpty() ) primaryKey=""; - else if (clusterKey.isEmpty() ) primaryKey=" (" + partitionKey + ")"; - else primaryKey=" (" + partitionKey + ")," + clusterKey; + if (partitionKey.isEmpty() ) + primaryKey=""; + else if (clusterKey.isEmpty() ) + primaryKey=" (" + partitionKey + ")"; + else + primaryKey=" (" + partitionKey + ")," + clusterKey; - if (primaryKey != null) fieldsString.append(", PRIMARY KEY (" + primaryKey + " )"); + if (primaryKey != null) + fieldsString.append(", PRIMARY KEY (" + primaryKey + " )"); } else { // end of length > 0 @@ -248,11 +255,15 @@ public class JsonTable { Status.BAD_REQUEST.getStatusCode()); } - if (partitionKey.isEmpty() ) primaryKey=""; - else if (clusterKey.isEmpty() ) primaryKey=" (" + partitionKey + ")"; - else primaryKey=" (" + partitionKey + ")," + clusterKey; + if (partitionKey.isEmpty() ) + primaryKey=""; + else if (clusterKey.isEmpty() ) + primaryKey=" (" + partitionKey + ")"; + else + primaryKey=" (" + partitionKey + ")," + clusterKey; - if (primaryKey != null) fieldsString.append(", PRIMARY KEY (" + primaryKey + " )"); + if (primaryKey != null) + fieldsString.append(", PRIMARY KEY (" + primaryKey + " )"); } fieldsString.append(")");