Renamed MStatementSqlException to MSqlStatementException.
authorMarco Zanon <info@marcozanon.com>
Thu, 22 Oct 2015 13:14:36 +0000 (13:14 +0000)
committerMarco Zanon <info@marcozanon.com>
Thu, 22 Oct 2015 13:14:36 +0000 (13:14 +0000)
4.x/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlConnection.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlStatementException.java [new file with mode: 0644]
4.x/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlTable.java
4.x/src/java/com/marcozanon/macaco/sql/MStatementSqlException.java [deleted file]

index 2922b411d4db84ae5edb56513371f8acf481f0fb..ed0a1960f91809d267a683f4966be49f47cadf1c 100644 (file)
@@ -9,8 +9,8 @@ package com.marcozanon.macaco.logging;
 import com.marcozanon.macaco.sql.MSqlConnection;
 import com.marcozanon.macaco.sql.MSqlConnectionFailureException;
 import com.marcozanon.macaco.sql.MSqlConnectionGenerator;
+import com.marcozanon.macaco.sql.MSqlStatementException;
 import com.marcozanon.macaco.sql.MSqlTable;
-import com.marcozanon.macaco.sql.MStatementSqlException;
 import com.marcozanon.macaco.text.MText;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -118,7 +118,7 @@ public class MLogDatabaseTable extends MLogTarget {
         catch (MSqlConnectionFailureException exception) {
             throw new MLoggingException("Could not write to database table.", exception);
         }
-        catch (MStatementSqlException exception) {
+        catch (MSqlStatementException exception) {
             throw new MLoggingException("Could not write to database table.", exception);
         }
     }
index a78045450ce737bb51868295c21072aa6e32076a..63424a5a57105629a787707b19e71316b2720d25 100644 (file)
@@ -195,11 +195,11 @@ public class MSqlConnection extends MObject {
 
     /* Statements */
 
-    public MSqlStatementResults executePreparedStatement(String statement) throws MStatementSqlException {
+    public MSqlStatementResults executePreparedStatement(String statement) throws MSqlStatementException {
         return this.executePreparedStatement(statement, new LinkedList<Object>());
     }
 
-    public MSqlStatementResults executePreparedStatement(String statement, LinkedList<Object> parameters) throws MStatementSqlException {
+    public MSqlStatementResults executePreparedStatement(String statement, LinkedList<Object> parameters) throws MSqlStatementException {
         if (MText.isBlank(statement)) {
             throw new IllegalArgumentException("Invalid 'statement': null or empty.");
         }
@@ -223,7 +223,7 @@ public class MSqlConnection extends MObject {
             if (MSqlConnection.TransactionStatus.SUCCESSFUL == this.getTransactionStatus()) {
                 this.setTransactionStatus(MSqlConnection.TransactionStatus.FAILED);
             }
-            throw new MStatementSqlException(String.format("Could not execute prepared statement: %s.", preparedStatement), exception);
+            throw new MSqlStatementException(String.format("Could not execute prepared statement: %s.", preparedStatement), exception);
         }
         return results;
     }
diff --git a/4.x/src/java/com/marcozanon/macaco/sql/MSqlStatementException.java b/4.x/src/java/com/marcozanon/macaco/sql/MSqlStatementException.java
new file mode 100644 (file)
index 0000000..9cc7d6d
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * Macaco
+ * Copyright (c) 2009-2015 Marco Zanon <info@marcozanon.com>.
+ * Released under MIT license (see LICENSE for details).
+ */
+
+package com.marcozanon.macaco.sql;
+
+@SuppressWarnings("serial")
+public class MSqlStatementException extends MSqlException {
+
+    /* */
+
+    public MSqlStatementException() {
+        super();
+    }
+
+    public MSqlStatementException(String message) {
+        super(message);
+    }
+
+    public MSqlStatementException(Throwable error) {
+        super(error);
+    }
+
+    public MSqlStatementException(String message, Throwable error) {
+        super(message, error);
+    }
+
+}
index 84e943a27533a0f32347cb70bad1a0a9e020f814..5c496e7ce08a5bda75e08ede6cbbf45ef6bcd584 100644 (file)
@@ -28,7 +28,7 @@ public class MSqlStatementResults extends MObject {
 
     /* */
 
-    public MSqlStatementResults(PreparedStatement preparedStatement) throws MStatementSqlException {
+    public MSqlStatementResults(PreparedStatement preparedStatement) throws MSqlStatementException {
         super();
         //
         if (null == preparedStatement) {
@@ -52,7 +52,7 @@ public class MSqlStatementResults extends MObject {
             }
         }
         catch (SQLException exception) {
-            throw new MStatementSqlException("Could not retrieve statement records.", exception);
+            throw new MSqlStatementException("Could not retrieve statement records.", exception);
         }
         //
         try {
@@ -63,7 +63,7 @@ public class MSqlStatementResults extends MObject {
             generatedKeysResultSet.close();
         }
         catch (SQLException exception) {
-            throw new MStatementSqlException("Could not retrieve generated keys.", exception);
+            throw new MSqlStatementException("Could not retrieve generated keys.", exception);
         }
     }
 
index a4084b385d1d010d2be58c8341bae7846ba73a3b..acbc6d490c535ad60c38f35b531f12b9c288fabd 100644 (file)
@@ -58,7 +58,7 @@ public class MSqlTable extends MObject {
 
     /* Statements */
 
-    protected MSqlStatementResults insertRecord(LinkedHashMap<String, Object> map) throws MStatementSqlException {
+    protected MSqlStatementResults insertRecord(LinkedHashMap<String, Object> map) throws MSqlStatementException {
         if (null == map) {
             throw new IllegalArgumentException("Invalid 'map': null.");
         }
@@ -79,7 +79,7 @@ public class MSqlTable extends MObject {
                                                                       p);
     }
 
-    protected MSqlStatementResults updateRecord(LinkedHashMap<String, Object> map, Object id) throws MStatementSqlException {
+    protected MSqlStatementResults updateRecord(LinkedHashMap<String, Object> map, Object id) throws MSqlStatementException {
         if (null == map) {
             throw new IllegalArgumentException("Invalid 'map': null.");
         }
@@ -101,7 +101,7 @@ public class MSqlTable extends MObject {
                                                                       p);
     }
 
-    public MSqlStatementResults setRecord(LinkedHashMap<String, Object> map, Object id) throws MStatementSqlException {
+    public MSqlStatementResults setRecord(LinkedHashMap<String, Object> map, Object id) throws MSqlStatementException {
         if (null == id) {
             return this.insertRecord(map);
         }
@@ -110,7 +110,7 @@ public class MSqlTable extends MObject {
         }
     }
 
-    public MSqlStatementResults getRecord(Object id) throws MStatementSqlException {
+    public MSqlStatementResults getRecord(Object id) throws MSqlStatementException {
         if (null == id) {
             throw new IllegalArgumentException("Invalid 'id': null.");
         }
@@ -123,7 +123,7 @@ public class MSqlTable extends MObject {
                                                                       p);
     }
 
-    public MSqlStatementResults deleteRecord(Object id) throws MStatementSqlException {
+    public MSqlStatementResults deleteRecord(Object id) throws MSqlStatementException {
         if (null == id) {
             throw new IllegalArgumentException("Invalid 'id': null.");
         }
@@ -135,7 +135,7 @@ public class MSqlTable extends MObject {
                                                                       p);
     }
 
-    public MSqlStatementResults deleteRecords(LinkedHashSet idSet) throws MStatementSqlException {
+    public MSqlStatementResults deleteRecords(LinkedHashSet idSet) throws MSqlStatementException {
         if (null == idSet) {
             throw new IllegalArgumentException("Invalid 'idSet': null.");
         }
diff --git a/4.x/src/java/com/marcozanon/macaco/sql/MStatementSqlException.java b/4.x/src/java/com/marcozanon/macaco/sql/MStatementSqlException.java
deleted file mode 100644 (file)
index ff363b0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Macaco
- * Copyright (c) 2009-2015 Marco Zanon <info@marcozanon.com>.
- * Released under MIT license (see LICENSE for details).
- */
-
-package com.marcozanon.macaco.sql;
-
-@SuppressWarnings("serial")
-public class MStatementSqlException extends MSqlException {
-
-    /* */
-
-    public MStatementSqlException() {
-        super();
-    }
-
-    public MStatementSqlException(String message) {
-        super(message);
-    }
-
-    public MStatementSqlException(Throwable error) {
-        super(error);
-    }
-
-    public MStatementSqlException(String message, Throwable error) {
-        super(message, error);
-    }
-
-}