Coder Social home page Coder Social logo

Comments (4)

mp911de avatar mp911de commented on May 30, 2024

Spring Data JPA isn't in the business of generating SQL statements.

Please enable Hibernate SQL logging and attach a stack trace. While I am afraid that this is a Hibernate issue, we still want to make sure that Spring isn't the one that causes the issue.

from spring-data-jpa.

rswain90 avatar rswain90 commented on May 30, 2024

Thanks for looking my issue. I just attached logs which is before & after Spring upgrade. I am surprised why its failing after just spring upgrade without any code changes. Please let me know if you need any more details.
BeforeSpringUpgradeLog.txt
AfterSpringUpgradeLog.txt

from spring-data-jpa.

mp911de avatar mp911de commented on May 30, 2024

The main difference is count(distinct productsou0_.id) as col_0_0_ vs.

        count(distinct productsou0_.attr_id,
        productsou0_.id,
        productsou0_.map_key) as col_0_0_

Can you please provide a minimal reproducer that contains the entity model and the affected repository query method?

from spring-data-jpa.

rswain90 avatar rswain90 commented on May 30, 2024

@mp911de I tried to analysis more & found that after spring boot upgrade its taking primary key(composite) of er_material table & before it was taking primary key of ed_material for getting count. As its taking composite primary key, query is failing for Count(Col1,col2,col3).
Old Query
from
er_material productsou0_
inner join
ed_material material1_
on productsou0_.id=material1_.id

As a resolution we changed our query like below & it starting picking primary key of ed_material.
from
ed_material material1_
inner join
er_material productsou0_
on productsou0_.id=material1_.id

Thanks you so much for looking my issue.

from spring-data-jpa.

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.