From: Marco Zanon Date: Thu, 22 Oct 2015 13:14:36 +0000 (+0000) Subject: Renamed MStatementSqlException to MSqlStatementException. X-Git-Tag: 4.0~14 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=f9b44723cde6a606cc7c8763077de0b9e020ea4a;p=Macaco Renamed MStatementSqlException to MSqlStatementException. --- diff --git a/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java b/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java index 2922b41..ed0a196 100644 --- a/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java +++ b/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java @@ -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); } } diff --git a/src/java/com/marcozanon/macaco/sql/MSqlConnection.java b/src/java/com/marcozanon/macaco/sql/MSqlConnection.java index a780454..63424a5 100644 --- a/src/java/com/marcozanon/macaco/sql/MSqlConnection.java +++ b/src/java/com/marcozanon/macaco/sql/MSqlConnection.java @@ -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()); } - public MSqlStatementResults executePreparedStatement(String statement, LinkedList parameters) throws MStatementSqlException { + public MSqlStatementResults executePreparedStatement(String statement, LinkedList 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/src/java/com/marcozanon/macaco/sql/MSqlStatementException.java b/src/java/com/marcozanon/macaco/sql/MSqlStatementException.java new file mode 100644 index 0000000..9cc7d6d --- /dev/null +++ b/src/java/com/marcozanon/macaco/sql/MSqlStatementException.java @@ -0,0 +1,30 @@ +/** + * Macaco + * Copyright (c) 2009-2015 Marco Zanon . + * 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); + } + +} diff --git a/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java b/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java index 84e943a..5c496e7 100644 --- a/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java +++ b/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java @@ -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); } } diff --git a/src/java/com/marcozanon/macaco/sql/MSqlTable.java b/src/java/com/marcozanon/macaco/sql/MSqlTable.java index a4084b3..acbc6d4 100644 --- a/src/java/com/marcozanon/macaco/sql/MSqlTable.java +++ b/src/java/com/marcozanon/macaco/sql/MSqlTable.java @@ -58,7 +58,7 @@ public class MSqlTable extends MObject { /* Statements */ - protected MSqlStatementResults insertRecord(LinkedHashMap map) throws MStatementSqlException { + protected MSqlStatementResults insertRecord(LinkedHashMap 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 map, Object id) throws MStatementSqlException { + protected MSqlStatementResults updateRecord(LinkedHashMap 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 map, Object id) throws MStatementSqlException { + public MSqlStatementResults setRecord(LinkedHashMap 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/src/java/com/marcozanon/macaco/sql/MStatementSqlException.java b/src/java/com/marcozanon/macaco/sql/MStatementSqlException.java deleted file mode 100644 index ff363b0..0000000 --- a/src/java/com/marcozanon/macaco/sql/MStatementSqlException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Macaco - * Copyright (c) 2009-2015 Marco Zanon . - * 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); - } - -}