Comments (5)
It's theoretically possible to get Jinq working with xtend (for example, I've already extended Jinq to mostly work with Scala). But in order to ensure the correctness of the queries it generates, Jinq only translates things it knows about into queries. xtend seems to be using methods that Jinq isn't familiar with like com/google/common/base/Objects:equal(Ljava/lang/Object;Ljava/lang/Object;)Z.
It is, of course, possible to make Jinq aware of those methods. Unfortunately, I currently don't have the time to learn xtend and map out all the methods it uses in its generated output.
from jinq.
By the way , I can say 'use jinq with xtend' is the best orm style in java development .
streams.streamAll(em, typeof(Customer))
.where[o|o.name=="Bob"].toList()
the code is as same beautiful as linq . At moment , my solution is using jquerydsl with xtend .
But jquerydsl's performence is slower than jinq . And xtend use the 'final function' with guava,
So I very hope that jinq can run with xtend.
from jinq.
I've added a new version of Jinq to Maven, version 1.8.6. This version should support translating Guava's Objects.equal()
to a database query. I don't have time to properly add support for extend and to do proper testing for it. But if you tell me which methods extend uses in its compiler output, then I can add support for those methods to Jinq.
from jinq.
I test 1.8.6, there is same error
Exception in thread "main" java.lang.IllegalArgumentException: Could not analyze lambda code
at org.jinq.jpa.transform.LambdaAnalysis.fullyAnalyzeLambda(LambdaAnalysis.java:197)
at org.jinq.jpa.transform.LambdaInfo.fullyAnalyze(LambdaInfo.java:116)
at org.jinq.jpa.JPAQueryComposer.applyTransformWithLambda(JPAQueryComposer.java:293)
at org.jinq.jpa.JPAQueryComposer.where(JPAQueryComposer.java:379)
at org.jinq.jpa.JPAQueryComposer.where(JPAQueryComposer.java:1)
at org.jinq.orm.stream.QueryJinqStream.where(QueryJinqStream.java:45)
at org.jinq.jpa.QueryJPAJinqStream.where(QueryJPAJinqStream.java:87)
at org.jinq.jpa.QueryJPAJinqStream.where(QueryJPAJinqStream.java:1)
at SampleMain.runSampleQueries(SampleMain.java:75)
at SampleMain.main(SampleMain.java:51)
Caused by: org.jinq.rebased.org.objectweb.asm.tree.analysis.AnalyzerException: Unknown static method com/google/common/base/Objects:equal(Ljava/lang/Object;Ljava/lang/Object;)Z encountered
at ch.epfl.labos.iu.orm.queryll2.symbolic.BasicSymbolicInterpreter.naryOperation(BasicSymbolicInterpreter.java:385)
at org.jinq.rebased.org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
at ch.epfl.labos.iu.orm.queryll2.path.CodePath.calculateReturnValueAndConditions(CodePath.java:148)
at ch.epfl.labos.iu.orm.queryll2.path.TransformationClassAnalyzer.analyzeMethod(TransformationClassAnalyzer.java:440)
at ch.epfl.labos.iu.orm.queryll2.path.TransformationClassAnalyzer.analyzeLambdaMethod(TransformationClassAnalyzer.java:406)
at org.jinq.jpa.transform.LambdaAnalysis.analyzeLambda(LambdaAnalysis.java:318)
at org.jinq.jpa.transform.LambdaAnalysis.fullyAnalyzeLambda(LambdaAnalysis.java:187)
... 9 more
from jinq.
I don't think this is going to work. I don't have the time to learn extend, so I can't do proper testing for it, so there's going to be too many errors like this.
I've tried 1.8.6, and I don't encounter any problems with Guava's Objects.equal()
method, so it must be something specific with extend, or perhaps extend isn't picking up the correct version of jinq-jpa from Maven Central or something like that.
Sorry. I don't think I'll be able to add support for extend after all.
from jinq.
Related Issues (20)
- toList() commit transaction ignoring JPA-Transactional HOT 3
- Question... How does Jinq guesses the operators in Lambdas HOT 1
- Anonymous class as a custom tuple HOT 6
- Could not translate code to a query HOT 6
- A Stream that returns a list of UUIDs is not serializable HOT 10
- fail with registerCustomSqlFunction HOT 5
- How to get the total count after group by? HOT 2
- How to get the number of groups HOT 1
- How to get the number of groups by issuing a separate query after group by? HOT 3
- Support java v21 HOT 5
- can't leftOuterJoin support subquery? HOT 2
- [BUG]: The concatenation of strings was not as expected HOT 4
- [Feature] join supports on condition HOT 1
- [Feature] Add support for additional collection libraries HOT 3
- Where filtering after select with projection gives error HOT 2
- Move from javax.persistence to jakarta.persistence. HOT 6
- Java 13 supported? HOT 2
- Compare int, datetime, bool to String HOT 1
- Could not analyze lambda code HOT 1
- jdk11 support HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jinq.