Permalink
Browse files

[jdbc-driver] Moves classes from package `acolyte` to `acolyte.jdbc`.…

… Classes in former package are deprecated, and will be removed in future release.
  • Loading branch information...
cchantep
cchantep committed Jul 3, 2014
1 parent 91a991c commit 9c261f107338c4a9d4364d89540f8965cb46c71f
Showing with 11,643 additions and 365 deletions.
  1. +10 −10 faq.md
  2. +2 −0 jdbc-driver/src/main/java/acolyte/AbstractCompositeHandler.java
  3. +2 −0 jdbc-driver/src/main/java/acolyte/AbstractResultSet.java
  4. +2 −0 jdbc-driver/src/main/java/acolyte/AbstractStatement.java
  5. +2 −0 jdbc-driver/src/main/java/acolyte/CallableStatement.java
  6. +2 −0 jdbc-driver/src/main/java/acolyte/Column.java
  7. +2 −0 jdbc-driver/src/main/java/acolyte/CompositeHandler.java
  8. +2 −0 jdbc-driver/src/main/java/acolyte/Connection.java
  9. +2 −0 jdbc-driver/src/main/java/acolyte/ConnectionHandler.java
  10. +2 −0 jdbc-driver/src/main/java/acolyte/DatabaseMetaData.java
  11. +2 −0 jdbc-driver/src/main/java/acolyte/Defaults.java
  12. +2 −10 jdbc-driver/src/main/java/acolyte/Driver.java
  13. +2 −0 jdbc-driver/src/main/java/acolyte/ImmutableArray.java
  14. +2 −0 jdbc-driver/src/main/java/acolyte/ParameterMetaData.java
  15. +2 −0 jdbc-driver/src/main/java/acolyte/PreparedStatement.java
  16. +2 −0 jdbc-driver/src/main/java/acolyte/QueryResult.java
  17. +2 −0 jdbc-driver/src/main/java/acolyte/Result.java
  18. +2 −0 jdbc-driver/src/main/java/acolyte/Row.java
  19. +2 −0 jdbc-driver/src/main/java/acolyte/Row1.java
  20. +2 −0 jdbc-driver/src/main/java/acolyte/RowList.java
  21. +2 −0 jdbc-driver/src/main/java/acolyte/Savepoint.java
  22. +2 −0 jdbc-driver/src/main/java/acolyte/StatementHandler.java
  23. +2 −0 jdbc-driver/src/main/java/acolyte/UpdateResult.java
  24. +198 −0 jdbc-driver/src/main/java/acolyte/jdbc/AbstractCompositeHandler.java
  25. +1,706 −0 jdbc-driver/src/main/java/acolyte/jdbc/AbstractResultSet.java
  26. +660 −0 jdbc-driver/src/main/java/acolyte/jdbc/AbstractStatement.java
  27. +1,424 −0 jdbc-driver/src/main/java/acolyte/jdbc/CallableStatement.java
  28. +108 −0 jdbc-driver/src/main/java/acolyte/jdbc/Column.java
  29. +96 −0 jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java
  30. +799 −0 jdbc-driver/src/main/java/acolyte/jdbc/Connection.java
  31. +42 −0 jdbc-driver/src/main/java/acolyte/jdbc/ConnectionHandler.java
  32. +1,745 −0 jdbc-driver/src/main/java/acolyte/jdbc/DatabaseMetaData.java
  33. +196 −0 jdbc-driver/src/main/java/acolyte/jdbc/Defaults.java
  34. +249 −0 jdbc-driver/src/main/java/acolyte/jdbc/Driver.java
  35. +281 −0 jdbc-driver/src/main/java/acolyte/jdbc/ImmutableArray.java
  36. +410 −0 jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java
  37. +971 −0 jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java
  38. +101 −0 jdbc-driver/src/main/java/acolyte/jdbc/QueryResult.java
  39. +27 −0 jdbc-driver/src/main/java/acolyte/jdbc/Result.java
  40. +26 −0 jdbc-driver/src/main/java/acolyte/jdbc/Row.java
  41. +89 −0 jdbc-driver/src/main/java/acolyte/jdbc/Row1.java
  42. +1,513 −0 jdbc-driver/src/main/java/acolyte/jdbc/RowList.java
  43. +99 −0 jdbc-driver/src/main/java/acolyte/jdbc/Savepoint.java
  44. +144 −0 jdbc-driver/src/main/java/acolyte/jdbc/StatementHandler.java
  45. +109 −0 jdbc-driver/src/main/java/acolyte/jdbc/UpdateResult.java
  46. +1 −1 jdbc-driver/src/main/resources/META-INF/services/java.sql.Driver
  47. +2 −1 jdbc-driver/src/main/templates/Row.tmpl
  48. +2 −1 jdbc-driver/src/main/templates/RowList.tmpl
  49. +2 −1 jdbc-driver/src/main/templates/RowLists.tmpl
  50. +15 −15 jdbc-driver/src/test/java/usecase/JavaUseCases.java
  51. 0 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/AbstractResultSetSpec.scala
  52. +13 −12 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/AbstractStatementSpec.scala
  53. +1 −1 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/AcolyteSpec.scala
  54. +1 −1 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/CallableStatementSpec.scala
  55. +2 −2 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/ColumnSpec.scala
  56. +4 −4 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/CompositeHandlerSpec.scala
  57. +1 −1 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/ConnectionHandlerSpec.scala
  58. +3 −3 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/ConnectionSpec.scala
  59. +4 −4 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/DatabaseMetaDataSpec.scala
  60. +19 −19 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/DriverSpec.scala
  61. +1 −1 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/ImmutableArraySpec.scala
  62. +3 −3 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/ParameterMetaDataSpec.scala
  63. +6 −6 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/PreparedStatementSpec.scala
  64. +4 −4 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/RowListSpec.scala
  65. +1 −1 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/RowSpec.scala
  66. +1 −1 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/SavepointSpec.scala
  67. +2 −2 jdbc-driver/src/test/scala/acolyte/{ → jdbc}/test.scala
  68. +4 −25 jdbc-scala/src/main/scala/Acolyte.scala
  69. +7 −7 jdbc-scala/src/main/scala/Execution.scala
  70. +318 −0 jdbc-scala/src/main/scala/jdbc/AcolyteDSL.scala
  71. +46 −0 jdbc-scala/src/main/scala/jdbc/Execution.scala
  72. +0 −95 jdbc-scala/src/main/templates/Acolyte.tmpl
  73. +3 −2 jdbc-scala/src/main/templates/RowList.tmpl
  74. +2 −6 jdbc-scala/src/main/templates/RowLists.tmpl
  75. +4 −4 jdbc-scala/src/test/scala/acolyte/{ → jdbc}/AcolyteSpec.scala
  76. +2 −2 jdbc-scala/src/test/scala/acolyte/{ → jdbc}/CompositeHandlerSpec.scala
  77. +4 −4 jdbc-scala/src/test/scala/acolyte/{ → jdbc}/ConnectionSpec.scala
  78. +2 −2 jdbc-scala/src/test/scala/acolyte/{ → jdbc}/ExecutionSpec.scala
  79. +3 −14 jdbc-scala/src/test/scala/acolyte/{ → jdbc}/RowSpec.scala
  80. +8 −8 jdbc-scala/src/test/scala/acolyte/{ → jdbc}/ScalaUseCases.scala
  81. +3 −2 project/Acolyte.scala
  82. +21 −13 project/JdbcDriver.scala
  83. +10 −6 project/JdbcScala.scala
  84. +1 −1 readme.md
  85. +17 −17 src/site/markdown/integration.md
  86. +26 −26 src/site/markdown/java.md
  87. +24 −24 src/site/markdown/scala.md
  88. +1 −1 studio/pom.xml
  89. +2 −2 studio/src/main/java/acolyte/Formatting.java
View
20 faq.md
@@ -9,7 +9,7 @@ To supports this behaviour, to return rows when you consider statement to be a q
Using composite handler, you can specify it using detection pattern(s) (regular expressions):
```java
import acolyte.CompositeHandler;
import acolyte.jdbc.CompositeHandler;
CompositeHandler handler = CompositeHandler.empty().
// Considers as query if starts with 'SELECT ' or contains 'EXEC fetch_data'
@@ -23,7 +23,7 @@ In previous example, handler is given different patterns. In such case, order in
Equivalent with the Scala DSL is:
```scala
import acolyte.Acolyte.handleStatement
import acolyte.jdbc.Acolyte.handleStatement
val handler = handleStatement.
withQueryDetection("^SELECT ", "EXEC fetch_data").
@@ -33,8 +33,8 @@ val handler = handleStatement.
With Scala DSL, if you want all statements to be considered as queries, you can use:
```scala
import acolyte.QueryExecution
import acolyte.Acolyte.handleQuery
import acolyte.jdbc.QueryExecution
import acolyte.jdbc.Acolyte.handleQuery
val handler = handleQuery { e: QueryExecution =>
// handleQueries
@@ -55,16 +55,16 @@ If you just need to mockup a result containing only 1 row with 1 column, single
Example:
```
overloaded method value rowList6 with alternatives:
[error] [A, B, C, D, E, F](x$1: acolyte.RowList.Column[A], x$2: acolyte.RowList.Column[B], x$3: acolyte.RowList.Column[C], x$4: acolyte.RowList.Column[D], x$5: acolyte.RowList.Column[E], x$6: acolyte.RowList.Column[F])acolyte.RowList6[A,B,C,D,E,F] <and>
[error] [A, B, C, D, E, F](x$1: Class[A], x$2: Class[B], x$3: Class[C], x$4: Class[D], x$5: Class[E], x$6: Class[F])acolyte.RowList6[A,B,C,D,E,F]
[error] [A, B, C, D, E, F](x$1: acolyte.jdbc.RowList.Column[A], x$2: acolyte.jdbc.RowList.Column[B], x$3: acolyte.jdbc.RowList.Column[C], x$4: acolyte.jdbc.RowList.Column[D], x$5: acolyte.jdbc.RowList.Column[E], x$6: acolyte.jdbc.RowList.Column[F])acolyte.jdbc.RowList6[A,B,C,D,E,F] <and>
[error] [A, B, C, D, E, F](x$1: Class[A], x$2: Class[B], x$3: Class[C], x$4: Class[D], x$5: Class[E], x$6: Class[F])acolyte.jdbc.RowList6[A,B,C,D,E,F]
[error] cannot be applied to ((Class[String], String), (Class[String], String), (Class[String], String), (Class[String], String), (Class[String], String), (Class[String], String))
```
It occurs when `acolyte.Implicits.PairAsColumn` is missing while using
It occurs when `acolyte.jdbc.Implicits.PairAsColumn` is missing while using
pimped Scala syntax to declare row list:
```scala
import acolyte.RowLists.rowList6
import acolyte.jdbc.RowLists.rowList6
// Corresponding to error example
// - will raise compilation error
@@ -80,8 +80,8 @@ rowList6(
Proper import simply fixes that:
```scala
import acolyte.RowLists.rowList6
import acolyte.Implicits.PairAsColumn // or acolyte.Implicits._
import acolyte.jdbc.RowLists.rowList6
import acolyte.jdbc.Implicits.PairAsColumn // or acolyte.jdbc.Implicits._
rowList6( // Now it's ok
classOf[String] -> "col1",
@@ -13,7 +13,9 @@
* Base for rule-based (immutable/thread-safe) statement handler.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.AbstractCompositeHandler}
*/
@Deprecated
public abstract class AbstractCompositeHandler<T extends AbstractCompositeHandler> implements StatementHandler {
// --- Properties ---
@@ -29,7 +29,9 @@
* Acolyte base resultset.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.AbstractResultSet}
*/
@Deprecated
public abstract class AbstractResultSet implements java.sql.ResultSet {
// --- Properties ---
@@ -20,7 +20,9 @@
* Acolyte base statement.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.AbstractStatement}
*/
@Deprecated
abstract class AbstractStatement implements java.sql.Statement {
// --- Shared ---
@@ -32,7 +32,9 @@
* Acolyte callable statement.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.CallableStatement}
*/
@Deprecated
public final class CallableStatement
extends PreparedStatement implements java.sql.CallableStatement {
@@ -7,7 +7,9 @@
* Column meta data.
*
* @author Cedric Chantepie
* @deprecated Use {@line acolyte.jdbc.Column}
*/
@Deprecated
public final class Column<T> {
// --- Properties ---
@@ -13,7 +13,9 @@
* Default implementation for composite handler.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.CompositeHandler}
*/
@Deprecated
public class CompositeHandler
extends AbstractCompositeHandler<CompositeHandler> {
@@ -27,7 +27,9 @@
* Acolyte connection.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Connection}
*/
@Deprecated
public final class Connection implements java.sql.Connection {
// --- Properties ---
@@ -5,7 +5,9 @@
*
* @author Cedric Chantepie
* @see StatementHandler
* @deprecated Use {@link acolyte.jdbc.ConnectionHandler}
*/
@Deprecated
public interface ConnectionHandler {
/**
@@ -9,7 +9,9 @@
* Acolyte meta-data.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.DatabaseMetaData}
*/
@Deprecated
public final class DatabaseMetaData implements java.sql.DatabaseMetaData {
// --- Properties ---
@@ -15,7 +15,9 @@
* Acolyte defaults.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Defaults}
*/
@Deprecated
final class Defaults {
/**
@@ -14,7 +14,9 @@
* Acolyte driver.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Driver}
*/
@Deprecated
public final class Driver implements java.sql.Driver {
// --- Constants ---
@@ -34,16 +36,6 @@
public static final HashMap<String,ConnectionHandler> handlers =
new HashMap<String,ConnectionHandler>();
// --- Shared ---
static {
try {
java.sql.DriverManager.registerDriver(new Driver());
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
} // end of catch
} // end of <cinit>
// --- Driver impl ---
/**
@@ -18,7 +18,9 @@
* Immutable Array implementation.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.ImmutableArray}
*/
@Deprecated
public final class ImmutableArray<T> implements Array {
// --- Properties ---
@@ -17,7 +17,9 @@
* Acolyte parameter meta-data.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.ParameterMetaData}
*/
@Deprecated
public final class ParameterMetaData implements java.sql.ParameterMetaData {
// --- Properties ---
@@ -64,7 +64,9 @@
* Acolyte prepared statement.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.PreparedStatement}
*/
@Deprecated
public class PreparedStatement
extends AbstractStatement implements java.sql.PreparedStatement {
@@ -6,7 +6,9 @@
* Query result.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.QueryResult}
*/
@Deprecated
public interface QueryResult extends Result<QueryResult> {
/**
@@ -6,7 +6,9 @@
* Row list result.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Result}
*/
@Deprecated
public interface Result<SELF extends Result> {
/**
@@ -4,7 +4,9 @@
/**
* Row marker interface
* @deprecated use {@line acolyte.jdbc.Row}
*/
@Deprecated
public interface Row {
/**
* Returns information for cell(s) of row.
@@ -9,7 +9,9 @@
/**
* Row with 1 cell.
* @deprecated Use {@line acolyte.jdbc.Row1}
*/
@Deprecated
public final class Row1<A> implements Row {
// --- Properties ---
@@ -25,7 +25,9 @@
* Type-safe list of row.
*
* @author Cedric Chantepie
* @deprecated use {@link acolyte.jdbc.RowList}
*/
@Deprecated
public abstract class RowList<R extends Row> {
/**
@@ -7,7 +7,9 @@
* Acolyte savepoint.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Savepoint}
*/
@Deprecated
public final class Savepoint implements java.sql.Savepoint {
// --- Properties ---
@@ -13,7 +13,9 @@
* Statement handler: allow to process statement by 'hand' and return.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.StatementHandler}
*/
@Deprecated
public interface StatementHandler {
/**
* When given |sql| query is executed against Acolyte connection ...
@@ -6,7 +6,9 @@
* Update result.
*
* @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.UpdateResult}
*/
@Deprecated
public final class UpdateResult implements Result<UpdateResult> {
// --- Shared ---
Oops, something went wrong.

0 comments on commit 9c261f1

Please sign in to comment.