Add AAF in a Nutshell to docs
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / helpers / MiscID.java
index e30336f..4d46c20 100644 (file)
@@ -4,7 +4,7 @@
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  * ===========================================================================
- * Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,6 +53,7 @@ public class MiscID  {
     public String sponsor;
     public String created;
     public String renewal;
+    public static String SELECT_QUERY = "SELECT ";
 
     private static final String FIELD_STRING = "id,created,sponsor,renewal";
     
@@ -64,9 +65,7 @@ public class MiscID  {
      * 2) DB "suits.cql"
      * 3) Alter existing Tables
      * @param row
-     * @throws BatchException 
-     * @throws IllegalAccessException 
-     * @throws IllegalArgumentException 
+     * @throws BatchException
      */
     public void set(String[] row ) throws BatchException {
         if (row.length<4) {
@@ -87,15 +86,15 @@ public class MiscID  {
     
 
     public static void load(Trans trans, Session session ) {
-        load(trans, session,"SELECT " + FIELD_STRING + " FROM authz.miscid;",data);
+        load(trans, session,SELECT_QUERY + FIELD_STRING + " FROM authz.miscid;",data);
     }
 
     public static void load(Trans trans, Session session, Map<String,MiscID> map ) {
-        load(trans, session,"SELECT " + FIELD_STRING + " FROM authz.miscid;",map);
+        load(trans, session,SELECT_QUERY + FIELD_STRING + " FROM authz.miscid;",map);
     }
 
     public static void loadOne(Trans trans, Session session, String id ) {
-        load(trans, session,"SELECT " + FIELD_STRING + " FROM authz.miscid WHERE id ='" + id + "';", data);
+        load(trans, session,SELECT_QUERY + FIELD_STRING + " FROM authz.miscid WHERE id ='" + id + "';", data);
     }
 
     public static void load(Trans trans, Session session, String query, Map<String,MiscID> map) {
@@ -140,13 +139,13 @@ public class MiscID  {
      */
     @Override
     public boolean equals(Object obj) {
-        if (obj!=null && obj instanceof MiscID) {
+        if (null!=obj && obj instanceof MiscID) {
             return id.equals(((MiscID)obj).id);
         }
         return false;
     }
 
-    public StringBuilder insertStmt() throws IllegalArgumentException, IllegalAccessException {
+    public StringBuilder insertStmt() {
         StringBuilder sb = new StringBuilder("INSERT INTO authz.miscid (");
         sb.append(FIELD_STRING);
         sb.append(") VALUES ('");