Giter VIP home page Giter VIP logo

Comments (5)

my2iu avatar my2iu commented on August 19, 2024

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.

flyzb618 avatar flyzb618 commented on August 19, 2024

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.

my2iu avatar my2iu commented on August 19, 2024

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.

flyzb618 avatar flyzb618 commented on August 19, 2024

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.

my2iu avatar my2iu commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.