Having played with Linq (to SQL and Objects) as well as the Entity Framework from Microsoft recently, I was wondering what the non-.Net (specifically Java) equivalents are?
Java does not have a Linq equivalent. However Scala, a functional language that compiles to Java byte code, has something closes: an extended for loop syntax.
You might want to check out the quaere project. Its a java framework that adds a way to query collections, similar to how LINQ works.
There is a Java project called JoSQL which provides object querying capabilities with a SQL-like syntax.
While I haven't used it myself, I know that it is used in some heavyweight applications.
For database-heavy work, SQLJ might be an option. The downside is it's not pure Java and requires a pre-processor.
Consider using Querydsl : http://source.mysema.com/display/querydsl/Querydsl
It supports JPA/Hibernate, JDO, SQL and Collections.
Querydsl is fully type-safe, supports autocomplete in IDEs and provides a common querying syntax on top multiple backends.
I am the maintainer of Querydsl, and I wrote a comparison to other frameworks some time ago.
It is slightly biased, but shows the different emphasis
- statically typed or not
- which backends are supported
- is the interface for query construction cascading or not
Newer frameworks experiment also with closure syntax.