Giter VIP home page Giter VIP logo

Comments (10)

my2iu avatar my2iu commented on August 19, 2024

Is the problem with UUID? I don't remember adding any specific code for handling UUID objects, so I'm not sure if that works. Where does the exception occur?

Also, I don't think Jinq can handle JPQL.isIn() with streams passed in from outside the query. I think it can handle Lists of objects passed in from outside the query, but you can't pass in entire streams. If you want to use streams in JPQL.isIn(), you must actually create the stream in the query itself:

proxyStream.where((proxy, source)->{
   var proxies = source.stream(ProxyEntity.class).where(item -> item.getClientId().equals(id))
							.select(ClientPerProxyEntity::getProxyId);
   return JPQL.isIn(proxy.getId(),proxies);
})

or something like that

from jinq.

OssNass avatar OssNass commented on August 19, 2024

then why it worked in the second example ?

Could be the existence of source is the key?

I think you are right, I will try and tell you of the results

from jinq.

my2iu avatar my2iu commented on August 19, 2024

I have no idea. It's been a while since I wrote the code for that, so maybe it does work. I can't really remember the details without digging through the code. But I don't think it should from what I can remember. Does that code appear inside another query?

Like I said, it might be the UUID issue. Which line does the exception occur from?

from jinq.

OssNass avatar OssNass commented on August 19, 2024

The exception occurs in this line:
proxyStream.where(proxy->JPQL.isIn(proxy.getId(),proxies)

from jinq.

my2iu avatar my2iu commented on August 19, 2024

Yeah, then it must be an issue with passing a stream into the query. Jinq's streams are not serializable. The stream has to be created inside the query itself, so that Jinq can analyze it.

from jinq.

my2iu avatar my2iu commented on August 19, 2024

I think you can also just call toList() to convert the stream into a list, and then you can pass the list into the query. But that will execute that subquery separately from the main query, which might be slow depending on what you're doing.

from jinq.

OssNass avatar OssNass commented on August 19, 2024

The problem is, after a certain 2700 items in the list SQL server refuses to perform the match

from jinq.

my2iu avatar my2iu commented on August 19, 2024

Yes, you will then need to run the whole query on the database. So you will have to construct the stream inside the query itself so that Jinq can analyze it and construct a database query from it.

from jinq.

OssNass avatar OssNass commented on August 19, 2024

Yes, you will then need to run the whole query on the database. So you will have to construct the stream inside the query itself so that Jinq can analyze it and construct a database query from it.

Working on it, I have a kind of abstraction layer for allowing me to dynamically construct where condition using Jinq in Spring Boot, I have done the moving from Where to WhereWithSource validating now

from jinq.

OssNass avatar OssNass commented on August 19, 2024

It worked, However, I need now validate every other old Where with the new WhereWithSource, I have a long day ahead of me.
Thanks

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.