Mirage

Mirage-SQL is an easy and powerful SQL centric database access library for Java (or JVM based languages) which provides dynamic SQL templates in plain SQL files.

License

License

GroupId

GroupId

jp.sf.amateras
ArtifactId

ArtifactId

mirage
Last Version

Last Version

1.2.5
Release Date

Release Date

Type

Type

jar
Description

Description

Mirage
Mirage-SQL is an easy and powerful SQL centric database access library for Java (or JVM based languages) which provides dynamic SQL templates in plain SQL files.
Project URL

Project URL

https://github.com/takezoe/mirage
Project Organization

Project Organization

Project Amateras
Source Code Management

Source Code Management

https://github.com/takezoe/mirage

Download mirage

How to add to project

<!-- https://jarcasting.com/artifacts/jp.sf.amateras/mirage/ -->
<dependency>
    <groupId>jp.sf.amateras</groupId>
    <artifactId>mirage</artifactId>
    <version>1.2.5</version>
</dependency>
// https://jarcasting.com/artifacts/jp.sf.amateras/mirage/
implementation 'jp.sf.amateras:mirage:1.2.5'
// https://jarcasting.com/artifacts/jp.sf.amateras/mirage/
implementation ("jp.sf.amateras:mirage:1.2.5")
'jp.sf.amateras:mirage:jar:1.2.5'
<dependency org="jp.sf.amateras" name="mirage" rev="1.2.5">
  <artifact name="mirage" type="jar" />
</dependency>
@Grapes(
@Grab(group='jp.sf.amateras', module='mirage', version='1.2.5')
)
libraryDependencies += "jp.sf.amateras" % "mirage" % "1.2.5"
[jp.sf.amateras/mirage "1.2.5"]

Dependencies

compile (7)

Group / Artifact Type Version
commons-dbcp : commons-dbcp jar 1.4
org.javassist : javassist jar 3.21.0-GA
ognl : ognl jar 3.1.12
org.springframework : spring-core Optional jar 3.2.5.RELEASE
org.springframework : spring-context Optional jar 3.2.5.RELEASE
org.springframework : spring-jdbc Optional jar 3.2.5.RELEASE
com.google.inject : guice Optional jar 4.0

provided (4)

Group / Artifact Type Version
junit : junit jar 4.12
org.apache.ant : ant jar 1.9.6
org.apache.geronimo.specs : geronimo-jta_1.1_spec jar 1.1.1
javax.servlet : servlet-api jar 2.5

test (5)

Group / Artifact Type Version
org.mockito : mockito-core jar 2.7.5
com.h2database : h2 jar 1.4.193
org.hsqldb : hsqldb jar 2.3.4
org.springframework : spring-aop jar 3.2.5.RELEASE
cglib : cglib jar 3.2.0

Project Modules

There are no modules declared in this project.

Mirage-SQL Build Status Maven Central Join the chat at https://gitter.im/mirage-sql/mirage-sql

Mirage-SQL is an easy and powerful SQL-centric database access library for Java (or JVM based languages) which provides dynamic SQL templates in plain SQL files.

Using

You can get Mirage-SQL from the Maven Central repository. Add the following fragment into your pom.xml.

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

or in a Gradle based project add to your build.gradle the following line:

compile 'com.miragesql:miragesql:2.1.0'

or just download it from the Release Page.

Other Mirage-SQL Modules:

Module Description Gradle Build
Mirage-SQL Test The testing functionality. testCompile 'com.miragesql:miragesql-test:2.1.0' Build Status
Mirage-SQL Tools The development tools. testCompile 'com.miragesql:miragesql-tools:2.1.0' Build Status
Mirage-SQL Integration The integration with Spring, Guice and Seasar2. compile 'com.miragesql:miragesql-integration:2.1.0' Build Status

If you are updating your application from a previous Mirage-SQL version, see the Migration Guide.

Example

This is a simple example of a SQL template:

SELECT * FROM BOOK
/*BEGIN*/
  WHERE
  /*IF author != null */
        AUTHOR = /*author*/'Naoki Takezoe'
  /*END*/
  /*IF minPrice != null */
    AND PRICE >= /*minPrice*/20
  /*END*/
  /*IF maxPrice != null */
    AND PRICE <= /*maxPrice*/100
  /*END*/
/*END*/
ORDER BY BOOK_ID ASC

With Mirage-SQL you can embed variables or conditions using special SQL comments, so it's a plain SQL that can be run with any SQL client tool directly. This feature used in the Mirage's SQL template it's called 2Way SQL.

Links:

Dependencies:

Module Dependencies

Versions

Version
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1