Git Product home page Git Product logo

Comments (8)

lpandzic avatar lpandzic commented on May 23, 2024 1

I'm not sure what you mean by swapping parents? In main branch parents look fine to me

public interface ProjectRepository extends PagingAndSortingRepository<ProjectEntity, UUID> {
  
  Page<ProjectEntity> findAllByOwner(UUID owner, Pageable pageable);
  
}

I suspect there's something wrong with findAllByOwner definition and spring data jdbc doesn't want to accept it.
Can you please update code in main and issue replication branch?

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 23, 2024 1

Ok, great, with my fix I now get on UserRepositoryTest (ProjectRepositoryTest passes).

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT "users"."ID" AS "ID", "users"."LASTNAME" AS "LASTNAME", "users"."FIRSTNAME" AS "FIRSTNAME" FROM "users" WHERE "users"."ID" = ?]; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "users.LASTNAME" not found; SQL statement:
SELECT "users"."ID" AS "ID", "users"."LASTNAME" AS "LASTNAME", "users"."FIRSTNAME" AS "FIRSTNAME" FROM "users" WHERE "users"."ID" = ? [42122-200]

I believe this exception is related #21 so I'll release a fix for this one.

from infobip-spring-data-querydsl.

bilak avatar bilak commented on May 23, 2024 1

working, thanks for fix.

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 23, 2024

I get

java.lang.ClassCastException: com.github.bilakpoc.springjdbcissues.data.entity.ProjectEntity cannot be cast to org.springframework.data.domain.Page
	at com.github.bilakpoc.springjdbcissues.data.repository.ProjectRepositoryTest.testPaging(ProjectRepositoryTest.java:22)

on main branch which has no infobip dependency. Can you check that query method is compatible with spring-data-jdbc?

from infobip-spring-data-querydsl.

bilak avatar bilak commented on May 23, 2024

Ah that's probably my bad, I was creating multiple issues that time.
Please just swap the parents in both repositories and you should see the error. If you want I can change that also in repo, just let me know.

from infobip-spring-data-querydsl.

bilak avatar bilak commented on May 23, 2024

Sorry I'm not going to update the main branch because there is another issue so I don't want to produce another error.

I've just changed the feature/querydsl branch where ProjectRepository extends PagingAndSortingRepository and method returns List instead of Page so when you run ProjectRepositoryTest you will get this error:

Caused by: java.lang.IllegalArgumentException: Could not resolve query class for interface com.github.bilakpoc.springjdbcissues.data.repository.ProjectRepository
	at com.infobip.spring.data.jdbc.QuerydslJdbcRepositoryFactory.getRelationalPathBaseFromQueryRepositoryClass(QuerydslJdbcRepositoryFactory.java:137)
	at com.infobip.spring.data.jdbc.QuerydslJdbcRepositoryFactory.getRepositoryFragments(QuerydslJdbcRepositoryFactory.java:68)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepositoryComposition(RepositoryFactorySupport.java:371)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:276)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:323)

If you change the parent of ProjectRepository from PagingAndSortingRepository to QuerydslJdbcRepository then it works, but I would suspect that application should work even with standard JDBC repositories.

Hope now it's more clear, sorry for misleading.

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 23, 2024

5.2.0 should be available on Cental in a few hours.

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 23, 2024

Can you confirm 5.2.0 fixes this?

from infobip-spring-data-querydsl.

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.