What are the Java equivalents to Linq and Entity F

2020-05-20 02:22发布

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?

8条回答
forever°为你锁心
2楼-- · 2020-05-20 02:24

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.

查看更多
Explosion°爆炸
3楼-- · 2020-05-20 02:29

Have a look at JaQue.

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2020-05-20 02:35

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.

查看更多
欢心
5楼-- · 2020-05-20 02:35

For database-heavy work, SQLJ might be an option. The downside is it's not pure Java and requires a pre-processor.

查看更多
家丑人穷心不美
6楼-- · 2020-05-20 02:35

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

查看更多
We Are One
7楼-- · 2020-05-20 02:38

There is no exact alternative which is universal as LINQ is. However if we are talking about LINQ to SQL then JPA is really an alternative when you use it with an IDE that supports "Inject language" feature. E.g. IDEA will do full scale completion of the JPA query within a string

查看更多
登录 后发表回答