Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Per-Åke 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-Åke 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-Åke 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-Åke 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-Åke 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-Åke 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-Åke Minborg
    @minborg
    ok. And the SQL dump when you run that stream is?
    Partha Nath
    @ParthaNath28
    yes
    The one I pasted above
    Per-Åke Minborg
    @minborg
    ok
    Strange. I will have to file an issue to verify this.
    Partha Nath
    @ParthaNath28
    ok
    thanks.
    Per-Åke 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
    return jpaStreamer.stream(Entity.class)
    .filter(Entity$.primaryKeyIdentifier.isNotNull())
    .count();
    I tried this one
    Per-Åke Minborg
    @minborg
    ok. Let’s wait for the issue to get examined.
    Thanks
    vinit patel
    @vinit_r_patel_twitter
    Hi Per-Ake, I had reported an issue last week regarding my Eclipse based Spring STS IDE could not detect the generated class even though they got generated and compiled successfully. Finally, I figured out that Eclipse based IDE does not like a file name ending with "$". If I rename the file name by replacing "$" with "", the IDE does recognize it. Is there any way to generate the source file with "" suffix instead of "$"?
    Per-Åke Minborg
    @minborg
    Ooops. Accoding to the Java Language Specification, a class can end with “_” and “$”. This must be a bug in Spring STS IDE/
    There is no way to replace the “$” (easilly). JPA is using “_” for its typed fields.
    (metadata)