JavaQ

Build Status Maven Release License

JavaQ takes care of building the sql query for you, rescuing you from the pain of remembering syntax for different dialects. With Java's static typing, JavaQ reduces the chances of making structural mistakes in the query.

Add javaq to your project

Repository

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Dependency

<dependency>
    <groupId>com.github.vivekmittal</groupId>
    <artifactId>javaq</artifactId>
    <version>v1.0.0</version>
</dependency>

Using JavaQ

import static com.javaq.JavaQ.select;

Select All

    select().from("EMPLOYEE").sql() 

Where Clause

    select("ID", "NAME").from("EMPLOYEE").where("ID = 1").sql()

Operators (AND/OR/LIKE/IN)

Joins

Order By

    select("ID", "NAME").from("EMPLOYEE")
        .orderBy("ID", Order.OrderType.ASC)
        .sql()

Group By

    select("NAME", "COUNT(*)").from("EMPLOYEE")
        .groupBy("NAME")
        .orderBy("COUNT(*)", ASC)
        .sql()

Limit

    select("NAME", "COUNT(*)").from("EMPLOYEE")
          .groupBy("NAME")
          .orderBy("COUNT(*)", ASC)
          .limit(10)
          .sql()

What's next?

CONTRIBUTING

Interested in contributing to JavaQ ? Here are some ways you can do that

Feel free to raise pull requests :)

LICENSE

MIT