Skip to content

Commit

Permalink
[jdbc-driver] Moves classes from package acolyte to acolyte.jdbc.…
Browse files Browse the repository at this point in the history
… Classes in former package are deprecated, and will be removed in future release.
  • Loading branch information
cchantep committed Jul 3, 2014
1 parent 91a991c commit 9c261f1
Show file tree
Hide file tree
Showing 89 changed files with 11,643 additions and 365 deletions.
20 changes: 10 additions & 10 deletions faq.md
Expand Up @@ -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): Using composite handler, you can specify it using detection pattern(s) (regular expressions):


```java ```java
import acolyte.CompositeHandler; import acolyte.jdbc.CompositeHandler;


CompositeHandler handler = CompositeHandler.empty(). CompositeHandler handler = CompositeHandler.empty().
// Considers as query if starts with 'SELECT ' or contains 'EXEC fetch_data' // Considers as query if starts with 'SELECT ' or contains 'EXEC fetch_data'
Expand All @@ -23,7 +23,7 @@ In previous example, handler is given different patterns. In such case, order in
Equivalent with the Scala DSL is: Equivalent with the Scala DSL is:


```scala ```scala
import acolyte.Acolyte.handleStatement import acolyte.jdbc.Acolyte.handleStatement


val handler = handleStatement. val handler = handleStatement.
withQueryDetection("^SELECT ", "EXEC fetch_data"). withQueryDetection("^SELECT ", "EXEC fetch_data").
Expand All @@ -33,8 +33,8 @@ val handler = handleStatement.
With Scala DSL, if you want all statements to be considered as queries, you can use: With Scala DSL, if you want all statements to be considered as queries, you can use:


```scala ```scala
import acolyte.QueryExecution import acolyte.jdbc.QueryExecution
import acolyte.Acolyte.handleQuery import acolyte.jdbc.Acolyte.handleQuery


val handler = handleQuery { e: QueryExecution => val handler = handleQuery { e: QueryExecution =>
// handleQueries // handleQueries
Expand All @@ -55,16 +55,16 @@ If you just need to mockup a result containing only 1 row with 1 column, single
Example: Example:
``` ```
overloaded method value rowList6 with alternatives: 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: 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.RowList6[A,B,C,D,E,F] [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)) [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: pimped Scala syntax to declare row list:


```scala ```scala
import acolyte.RowLists.rowList6 import acolyte.jdbc.RowLists.rowList6


// Corresponding to error example // Corresponding to error example
// - will raise compilation error // - will raise compilation error
Expand All @@ -80,8 +80,8 @@ rowList6(
Proper import simply fixes that: Proper import simply fixes that:


```scala ```scala
import acolyte.RowLists.rowList6 import acolyte.jdbc.RowLists.rowList6
import acolyte.Implicits.PairAsColumn // or acolyte.Implicits._ import acolyte.jdbc.Implicits.PairAsColumn // or acolyte.jdbc.Implicits._


rowList6( // Now it's ok rowList6( // Now it's ok
classOf[String] -> "col1", classOf[String] -> "col1",
Expand Down
Expand Up @@ -13,7 +13,9 @@
* Base for rule-based (immutable/thread-safe) statement handler. * Base for rule-based (immutable/thread-safe) statement handler.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.AbstractCompositeHandler}
*/ */
@Deprecated
public abstract class AbstractCompositeHandler<T extends AbstractCompositeHandler> implements StatementHandler { public abstract class AbstractCompositeHandler<T extends AbstractCompositeHandler> implements StatementHandler {


// --- Properties --- // --- Properties ---
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/AbstractResultSet.java
Expand Up @@ -29,7 +29,9 @@
* Acolyte base resultset. * Acolyte base resultset.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.AbstractResultSet}
*/ */
@Deprecated
public abstract class AbstractResultSet implements java.sql.ResultSet { public abstract class AbstractResultSet implements java.sql.ResultSet {


// --- Properties --- // --- Properties ---
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/AbstractStatement.java
Expand Up @@ -20,7 +20,9 @@
* Acolyte base statement. * Acolyte base statement.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.AbstractStatement}
*/ */
@Deprecated
abstract class AbstractStatement implements java.sql.Statement { abstract class AbstractStatement implements java.sql.Statement {
// --- Shared --- // --- Shared ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/CallableStatement.java
Expand Up @@ -32,7 +32,9 @@
* Acolyte callable statement. * Acolyte callable statement.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.CallableStatement}
*/ */
@Deprecated
public final class CallableStatement public final class CallableStatement
extends PreparedStatement implements java.sql.CallableStatement { extends PreparedStatement implements java.sql.CallableStatement {


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Column.java
Expand Up @@ -7,7 +7,9 @@
* Column meta data. * Column meta data.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@line acolyte.jdbc.Column}
*/ */
@Deprecated
public final class Column<T> { public final class Column<T> {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/CompositeHandler.java
Expand Up @@ -13,7 +13,9 @@
* Default implementation for composite handler. * Default implementation for composite handler.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.CompositeHandler}
*/ */
@Deprecated
public class CompositeHandler public class CompositeHandler
extends AbstractCompositeHandler<CompositeHandler> { extends AbstractCompositeHandler<CompositeHandler> {


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Connection.java
Expand Up @@ -27,7 +27,9 @@
* Acolyte connection. * Acolyte connection.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Connection}
*/ */
@Deprecated
public final class Connection implements java.sql.Connection { public final class Connection implements java.sql.Connection {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/ConnectionHandler.java
Expand Up @@ -5,7 +5,9 @@
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @see StatementHandler * @see StatementHandler
* @deprecated Use {@link acolyte.jdbc.ConnectionHandler}
*/ */
@Deprecated
public interface ConnectionHandler { public interface ConnectionHandler {


/** /**
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/DatabaseMetaData.java
Expand Up @@ -9,7 +9,9 @@
* Acolyte meta-data. * Acolyte meta-data.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.DatabaseMetaData}
*/ */
@Deprecated
public final class DatabaseMetaData implements java.sql.DatabaseMetaData { public final class DatabaseMetaData implements java.sql.DatabaseMetaData {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Defaults.java
Expand Up @@ -15,7 +15,9 @@
* Acolyte defaults. * Acolyte defaults.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Defaults}
*/ */
@Deprecated
final class Defaults { final class Defaults {


/** /**
Expand Down
12 changes: 2 additions & 10 deletions jdbc-driver/src/main/java/acolyte/Driver.java
Expand Up @@ -14,7 +14,9 @@
* Acolyte driver. * Acolyte driver.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Driver}
*/ */
@Deprecated
public final class Driver implements java.sql.Driver { public final class Driver implements java.sql.Driver {
// --- Constants --- // --- Constants ---


Expand All @@ -34,16 +36,6 @@ public final class Driver implements java.sql.Driver {
public static final HashMap<String,ConnectionHandler> handlers = public static final HashMap<String,ConnectionHandler> handlers =
new HashMap<String,ConnectionHandler>(); 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 --- // --- Driver impl ---


/** /**
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/ImmutableArray.java
Expand Up @@ -18,7 +18,9 @@
* Immutable Array implementation. * Immutable Array implementation.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.ImmutableArray}
*/ */
@Deprecated
public final class ImmutableArray<T> implements Array { public final class ImmutableArray<T> implements Array {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/ParameterMetaData.java
Expand Up @@ -17,7 +17,9 @@
* Acolyte parameter meta-data. * Acolyte parameter meta-data.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.ParameterMetaData}
*/ */
@Deprecated
public final class ParameterMetaData implements java.sql.ParameterMetaData { public final class ParameterMetaData implements java.sql.ParameterMetaData {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/PreparedStatement.java
Expand Up @@ -64,7 +64,9 @@
* Acolyte prepared statement. * Acolyte prepared statement.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.PreparedStatement}
*/ */
@Deprecated
public class PreparedStatement public class PreparedStatement
extends AbstractStatement implements java.sql.PreparedStatement { extends AbstractStatement implements java.sql.PreparedStatement {


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/QueryResult.java
Expand Up @@ -6,7 +6,9 @@
* Query result. * Query result.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.QueryResult}
*/ */
@Deprecated
public interface QueryResult extends Result<QueryResult> { public interface QueryResult extends Result<QueryResult> {


/** /**
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Result.java
Expand Up @@ -6,7 +6,9 @@
* Row list result. * Row list result.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Result}
*/ */
@Deprecated
public interface Result<SELF extends Result> { public interface Result<SELF extends Result> {


/** /**
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Row.java
Expand Up @@ -4,7 +4,9 @@


/** /**
* Row marker interface * Row marker interface
* @deprecated use {@line acolyte.jdbc.Row}
*/ */
@Deprecated
public interface Row { public interface Row {
/** /**
* Returns information for cell(s) of row. * Returns information for cell(s) of row.
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Row1.java
Expand Up @@ -9,7 +9,9 @@


/** /**
* Row with 1 cell. * Row with 1 cell.
* @deprecated Use {@line acolyte.jdbc.Row1}
*/ */
@Deprecated
public final class Row1<A> implements Row { public final class Row1<A> implements Row {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/RowList.java
Expand Up @@ -25,7 +25,9 @@
* Type-safe list of row. * Type-safe list of row.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated use {@link acolyte.jdbc.RowList}
*/ */
@Deprecated
public abstract class RowList<R extends Row> { public abstract class RowList<R extends Row> {


/** /**
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/Savepoint.java
Expand Up @@ -7,7 +7,9 @@
* Acolyte savepoint. * Acolyte savepoint.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.Savepoint}
*/ */
@Deprecated
public final class Savepoint implements java.sql.Savepoint { public final class Savepoint implements java.sql.Savepoint {
// --- Properties --- // --- Properties ---


Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/StatementHandler.java
Expand Up @@ -13,7 +13,9 @@
* Statement handler: allow to process statement by 'hand' and return. * Statement handler: allow to process statement by 'hand' and return.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.StatementHandler}
*/ */
@Deprecated
public interface StatementHandler { public interface StatementHandler {
/** /**
* When given |sql| query is executed against Acolyte connection ... * When given |sql| query is executed against Acolyte connection ...
Expand Down
2 changes: 2 additions & 0 deletions jdbc-driver/src/main/java/acolyte/UpdateResult.java
Expand Up @@ -6,7 +6,9 @@
* Update result. * Update result.
* *
* @author Cedric Chantepie * @author Cedric Chantepie
* @deprecated Use {@link acolyte.jdbc.UpdateResult}
*/ */
@Deprecated
public final class UpdateResult implements Result<UpdateResult> { public final class UpdateResult implements Result<UpdateResult> {
// --- Shared --- // --- Shared ---


Expand Down

0 comments on commit 9c261f1

Please sign in to comment.