Jevgeni has posted 19 posts at DZone. You can read more from them at their website. View Full User Profile

Announcing Squill: Not Another ORM

12.12.2008
| 4109 views |
  • submit to reddit

It is with great pleasure that we announce the first release of Squill. Download it now or check out the quickstart guide, the step-by-step tutorial and the Devoxx presentation.

Squill is a slick internal DSL for writing SQL queries in pure Java. It uses the database metadata and generics to catch as many errors as possible during compilation and is almost completely typesafe.

At the same time it is designed to allow everything SQL allows you to do, exactly the way SQL is meant to do it. This means that you're encouraged to select only the data you need and no hidden queries are generated for you, leaving you in full control of the query performance. Squill supports database-specific extensions, allowing you to both use advanced features and fully tweak your queries.

Squill also has special support for CRUD operations and table relations, adding some sugar over vanilla SQL. A typical Squill query looks like this:

ComplaintTable c = new ComplaintTable();	 
for (Tuple2 tuple2: squill .from(c, c.customer)
.where( gt(c.customer.isActive, 0),
notNull(c.percentSolved),
notNull(c.refoundSum))
.orderBy(desc(c.customer.id))
.selectList( c.customer.lastName, c.percentSolved))
{ System.out.println( "Customer " + tuple2.v1 + " has a complaint solved " + tuple2.v2 + "%"); }

Squill is a very young project and you can follow (and help) its development by joining the user or developer mailing lists.

Yours truly,
Juhan Aasaru, Michael Hunger and Jevgeni Kabanov

0
Published at DZone with permission of its author, Jevgeni Kabanov.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags: