aspose file tools*
The moose likes Other Open Source Projects and the fly likes LINQ-like extension for Java - SBQL4J Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "LINQ-like extension for Java - SBQL4J" Watch "LINQ-like extension for Java - SBQL4J" New topic
Author

LINQ-like extension for Java - SBQL4J

Emil Wcislo
Greenhorn

Joined: Mar 19, 2010
Posts: 4
Hello,
I'd like to invite You to see my new open-source library SBQL4J.
It's a query language which provides capabilities similar to Microsoft LINQ for .net technology.
Project home
Any comments are welcome.

Best Regards,
Emil

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

And Welcome to Javaranch!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Interesting; I was wondering how long it would take for someone to take a stab at this with the OpenJDK.
Emil Wcislo
Greenhorn

Joined: Mar 19, 2010
Posts: 4
David Newton wrote:Interesting; I was wondering how long it would take for someone to take a stab at this with the OpenJDK.

The OpenJDK Compiler is well-written, so the code was quite readable for me, but Java code parser is written "by hand". No grammar compiler (like Java Cup) were used to write it. So it taked me one day or two to add new clause (queries are surrounded by #{ } ) to parser.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Would you please explain to me what is LINQ/SBQL4J?
A DSL for doing DB queries?
How it differs from -for example- HQL?
Thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you look at the project page? The difference is clear.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

I didn't get what it is.
A DSL for dealing with DB, a DSL for filtering collections? code generator?
Sorry but I didn't get it.
I'm sleepy, maybe this is why :p
Emil Wcislo
Greenhorn

Joined: Mar 19, 2010
Posts: 4
SBQL4J is an extension to Java language to provide query language for processing Java objects.
Not only filtering is possible, but also more sophisticated operators are build-in, like aggregating and joining.
Available operators:
- arythmetic: +, -. *, /, %, == , != , >, <, >=, <=, OR, AND, NOT, INSTANCEOF
- aggregating: SUM, COUNT, AVG, MIN, MAX
- set operators: UNION, INTERSECT, UNIQUE, MINUS, IN, ',' (comma - cartesian product)
- quantifiers: ALL, ANY
- non-algerbraic operators . (dot - projection) , WHERE, JOIN, ORDER BY, CLOSE BY (transitive closure - sth like CONNECT BY in Oracle)
Also invoking Java methods and constructors is possible inside queries.

SBQL4J follow software engineering principles such as orthogonality, modularity, minimality, universality, typing safety, and clean, precise semantics.

It integrates tightly with Java which means:
- Java variables can be used in queries directly (no special syntax like setParameterX is required).
- Queries returns Java objects.
- Java methods and constructors can be invoked inside queries.
- Query language is type-safe - queries are checked in compile time.
- Queries can be translated to pure Java code (with no reflection usage) so execution is very fast.

SBQL4J gives Java developers full power of SBQL language (http://sbql.pl/overview/). Multiply nested and complicated queries are well-supported, which can't be written in any other query language (including LINQ).
Emil Wcislo
Greenhorn

Joined: Mar 19, 2010
Posts: 4
I've updated project webpage. I hope it's more clearly now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LINQ-like extension for Java - SBQL4J