• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

LINQ-like extension for Java - SBQL4J

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to Javaranch!
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting; I was wondering how long it would take for someone to take a stab at this with the OpenJDK.
 
Emil Wcislo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the project page? The difference is clear.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've updated project webpage. I hope it's more clearly now.
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!