Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the Java equivalents to Linq and Entity Framework

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?

like image 259
Colin Desmond Avatar asked Jul 04 '09 22:07

Colin Desmond


People also ask

Does Java have an equivalent to LINQ?

There is nothing like LINQ for Java. 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.

What is the Java equivalent of Entity Framework?

The standard ORM API in Java it's called JPA, and is part of the Java EE specification. Another alternative would be to use Hibernate.

Is LINQ same as Entity Framework?

Entity Framework is an object-relational mapping (ORM) framework for connecting C# code to external databases, usually SQL Server. LINQ is a query language embedded into C# and a set of extension methods in order to make it useful.

Is Hibernate same as Entity Framework?

nHibernate supports all types of databases but Entity framework need additional connectors to support databases other than MSSQL. nHibernate can be extended in terms of data loading, SQL generation, custom column types, custom collections etc but entity framework has limited extension points.


1 Answers

Consider using Querydsl : http://www.querydsl.com

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.

like image 168
Timo Westkämper Avatar answered Sep 19 '22 07:09

Timo Westkämper