Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Per Minborg
    @minborg
    Great! Thanks!
    Kai
    @SchlauFuchs
    i was curious to try jpa-streamer, but failed to get it working with JPA entities written in kotlin. the gradle build does not generate code, or I was not able to find it. anyone having some hints on this?
    Per Minborg
    @minborg
    Here is an issue for @SchlauFuchs question for those of you that want to follow the discussion: speedment/jpa-streamer#213
    Kai
    @SchlauFuchs
    yes, that's me crossposting :P
    Per Minborg
    @minborg
    Always good to get attenttion :-)
    vinit patel
    @vinit_r_patel_twitter

    I have added the following in my POM.xml file to make the Spring STS (Eclipse) IDE, the JPAStreamer aware. However, It still does not recognize any code which has "$" (e.g. jpaStreamer.stream(User.class)
    .filter(User$.country.equal("Germany").and(User$.firstName.equal("Otto")))
    .count(); )

    Added the following in my POM.xml

    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
    <execution>
    <phase>generate-sources</phase>
    <goals>
    <goal>add-source</goal>
    </goals>
    <configuration>
    <sources>
    <source>
    ${project.build.directory}/generated-sources/annotations
    </source>
    </sources>
    </configuration>
    </execution>
    </executions>
    </plugin>

    Per Minborg
    @minborg
    Elipse has proven to be more difficult to integrate than other IDEs. Are you able to test IntelliJ for example? Make sure the annotation processor is enabled.
    vinit patel
    @vinit_r_patel_twitter
    Thank you Per-Ake for the prompt response. I really appreciate it. Unfortunately, all team members use Spring STS (Eclipse). So, it would be difficult to convince them to switch to other IDE. I was just wondering whether I missed any steps or configuration to make the IDE JPAStreamer aware. I read somewhere that it should generate some code but I did not see any code generation. So, I though I was missing something.
    Per Minborg
    @minborg
    Are you able to check how Java annotation processors are handled by Spring STS? It is the annotation processor that dynamically generates the classes. Alternately, you could run under another IDE (just you) and copy the generated classes to your team mates.
    vinit patel
    @vinit_r_patel_twitter
    Thank you. I could see several java files with "$" suffix in the "/target/geneated-source/annotation/ " folder. So, it did generate the classes. Now I need to figure out why the IDE is still complaining. Thank you for giving me some hints.
    Per Minborg
    @minborg
    Oftentimes there is a command for setting the root for generated classes in IDEs.
    So the annotation processor works. That is usually the hard part. Good news.
    vinit patel
    @vinit_r_patel_twitter
    Thank you. I will check it out.
    Partha Nath
    @ParthaNath28
    Hello. I have tried to get a count of all records from database by using the following snippet.
    return jpaStreamer.stream(Entity.class).count();
    This is returning count as 1
    but when I fire a query like return jpaStreamer.stream(Entity.class).toList().stream().count(); it is taking almost 5 minutes to bring back a count of 200 thousand records.
    Is there an efficient way of getting the count without waiting for such an enormous time? Thanks
    Per Minborg
    @minborg
    Hi. return jpaStreamer.stream(Entity.class).count() is the way to go. If you enable logging of SQL querries, what do you see then?
    Per Minborg
    @minborg
    I think that looks as expected. If you cut and paste that code into an SQL tool, what result do you get?
    WHsat database type are you using?
    Partha Nath
    @ParthaNath28
    oracle
    the query works fine
    Per Minborg
    @minborg
    But you always get “1” as a result?
    When using the stream?
    Partha Nath
    @ParthaNath28
    By using the stream I am getting the correct number but it takes an enormous amount of time.
    3 minutes
    Per Minborg
    @minborg
    I mean, if you are using jpaStreamer.stream(Entity.class).count();
    Was the SQL dump from when you used the command jpaStreamer.stream(Entity.class).count();?
    Partha Nath
    @ParthaNath28
    jpaStreamer.stream(Entity.class).count()
    image.png
    I have pasted the screenshot
    from my intellij debugger window.
    Per Minborg
    @minborg
    ok. And the SQL dump when you run that stream is?
    Partha Nath
    @ParthaNath28
    yes
    The one I pasted above
    Per Minborg
    @minborg
    ok
    Strange. I will have to file an issue to verify this.
    Partha Nath
    @ParthaNath28
    ok
    thanks.
    Per Minborg
    @minborg
    Please add any extra information you can think of.
    (the issue is public)
    As a work-around, you could add a predicate that is always true in the stream pipeline using .filter() and see if that solves the problem (another renderer will be used in this case).
    .filter($Person.name.notEquals(“71287618717187hdvahashv”))
    Partha Nath
    @ParthaNath28
    ok
    thanks
    Partha Nath
    @ParthaNath28
    sorry this did not work either
    the sql is generated fine and giving correct record count
    but from java its still 1