Everyone who programmed with C# knows that there is the Entity Framework as ORM (object-relational mapper) which enable programmer to query database using only C# code.
For example, if I have a database called Shop
, and in the Shop
database I have Products
table, i can get all product of Products
table where their price is less than 2 dollar in the following way:
ShopEntity _Db = new ShopEntity();
List<Product> products = _Db.Products.Where(p => p.Price < 2).ToList();
The above code is equivalent to this SQL statement:
Select * From Products Where Price < 2
I want to know is there any framework like that in Java?
I also saw quaere. But it just queries collections. I want to query against the database. There is another framework in java called Hibernate which does not provide good functionality for query the database.