Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select-Query for PlayerStatistics not working #19

Open
ahahn94 opened this issue Jan 27, 2022 · 0 comments
Open

Select-Query for PlayerStatistics not working #19

ahahn94 opened this issue Jan 27, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ahahn94
Copy link
Contributor

ahahn94 commented Jan 27, 2022

I couldn't get the Select-Query for the PlayerStatistics working in time. Thus, the required data for awarding the achievements to the players can't be obtained. This only concerns the round-based achievements, the scoreboard trophies aren't affected by this.

The awarding and persisting of trophies and achievements is working perfectly fine in unit tests, with the faulty query being mocked via Mockito. It is also hooked up into the game lifecycle and the lifecycle hook has also been tested with unit tests.

So, if the query is fixed, achievements should be awarded by the service. Right now, though, the query only results in a valid Player and all statistics defaulting to 0.

I'm really annoyed by this issue, as I wasted half a day on trying to fix this - without any progress. As soon as I add a JOIN to the query (LEFT JOIN, so no risk of eliminating datasets of the existing query), the result set stays empty.

The query:

@Query("SELECT new com.github.tmd.gamelog.adapter.jpa.dto.PlayerStatisticsDto(p, 0, 0, 0, 0) from PlayerDto p")

@ahahn94 ahahn94 added the bug Something isn't working label Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant