What is Java equivalent for LINQ?
There is nothing like LINQ for Java.
...
Edit
Now with Java 8 we are introduced to the Stream API, this is a similar kind of thing when dealing with collections, but it is not quite the same as Linq.
If it is an ORM you are looking for, like Entity Framework, then you can try Hibernate
:-)
You can select the items in a collection (and much more) in a more readable way by using the lambdaj library
https://code.google.com/archive/p/lambdaj/
It has some advantages over the Quaere library because it doesn't use any magic string, it is completely type safe and in my opinion it offers a more readable DSL.
You won't find an equivalent of LINQ unless you use the javacc to create your own equivalent.
Until that day when someone finds a viable way to do so, there are some good alternatives, such as
There is a project called quaere.
It's a Java framework which adds the ability to query collections.
Note: According to the author, the project is not maintained anymore.
There are many LINQ equivalents for Java, see here for a comparison.
For a typesafe Quaere/LINQ style framework, consider using Querydsl. Querydsl supports JPA/Hibernate, JDO, SQL and Java Collections.
I am the maintainer of Querydsl, so this answer is biased.
Java LINQ to SQL implementation. Provides full language integration and larger feature set compared to .NET LINQ.
See SBQL4J. It's type-safe strong query language integrated with Java. Allows to write complicated and multiply nested queries. There is a lot of operators, Java methods can be invoked inside queries so as constructors. Queries are translated to pure Java code (there is no reflection at runtime) so execution is very fast.
EDIT: Well, so far SBQL4J it's the ONLY extension to Java language which gives query capabilities similar to LINQ. There are some interesting project like Quaere and JaQue but they are only API's, not syntax / semantics extension with strong type safety in compile time.