Skip to content
aadrian edited this page Nov 11, 2017 · 10 revisions

Migrating from older versions of Mirage-SQL

Migrating from Mirage =<1.2.5 to 1.3.0

Mirge-SQL was moved to a new GitHub Organisation https://github.com/mirage-sql , so the artifacts were renamed from:

<dependency>
    <groupId>jp.sf.amateras</groupId>
    <artifactId>mirage</artifactId>
    <version>1.2.5</version>
</dependency>

and

compile 'jp.sf.amateras:mirage:1.2.5'

to:

<dependency>
    <groupId>com.miragesql</groupId>
    <artifactId>miragesql</artifactId>
    <version>1.3.0</version>
</dependency>

and

compile 'com.miragesql:miragesql:1.3.0'

Migrating from Mirage 1.3.0 to 2.0.x

1. Imports

Mirage-SQL sources were refactored to use the new Github Organization package name, so you have to change all you imports from:

import jp.sf.amateras.mirage.*;

to

import com.miragesql.miragesql.*;

2. Logging

Mirage-SQL was refactored to use https://www.slf4j.org/ instead of java.util.logging (JUL) . If your application is using JUL, you could migrate it to SLF4J as described https://www.slf4j.org/migrator.html

Note the logging levels between JUL and SLF4j:

FINEST  -> TRACE
FINER   -> DEBUG
FINE    -> DEBUG
CONFIG  -> INFO
INFO    -> INFO
WARNING -> WARN
SEVERE  -> ERROR

3. New Connection Pool

Mirage-SQL now supports HikariCP. If you were using DBCP, please update your code to use HikariCP. Mirage-SQL has support for all HikariCP configuration properties: https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby .

4. Deprecations

Deprecated code from Mirage-SQL =<1.2.5 was removed in 2.0.0 .

Methods having an sqlPath (a String representhing the path of an sql file) or an SQL itself, were deprecated and replaced with ones using SqlResource.

method(String sqlPath, ...) -> method(SqlResource resource, ...) 
   ==>  method(new ClasspathSqlResource(sqlPath)) 

method(String sql, ...) -> method(SqlResource resource, ...) 
   ==> use new StringSqlResource(sql)

5. Removed Utilities

The following utilities:

  • com/miragesql/miragesql/util/Base64Util.java
  • com/miragesql/miragesql/util/ArrayMap.java
  • miragesql/miragesql/util/CaseInsensitiveMap.java

were removed, since Mirage-SQL wasn't using them anymore. If you were using those utilities, please use Apache Commons libraries, since there is the up to date implementation of them.

Migrating from Mirage 2.0.x to 2.1.x

1. Modules

Mirage-SQL monolitic JAR was split into several smaller JARs:

  1. Mirage-SQL - miragesql-2.1.0.jar - the core functionality
  2. Mirage-SQL Test - miragesql-test-2.1.0.jar - the testing functionality
  3. Mirage-SQL Tools - miragesql-tools-2.1.0.jar - the tooling
  4. Mirage-SQL Integration - miragesql-integration-2.1.0.jar - the integration with Spring, Guice and Seasar2

Depending on your use case, the only migration needed is to also include JAR #2, #3 or #4 in your build system.

2. Imports

Package com.miragesql.miragesql.tool was refactored to com.miragesql.miragesql.tools for naming consistency.

Migrating from Mirage 2.x.x to 3.0.x

Several new features from the community wishlist Take the following steps to to migrate your application:

  • tbd