Skip to content

version 2.7.8 native delete query cause NullPointerException #2813

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

Closed
geewit opened this issue Feb 22, 2023 · 3 comments
Closed

version 2.7.8 native delete query cause NullPointerException #2813

geewit opened this issue Feb 22, 2023 · 3 comments
Labels
status: duplicate A duplicate of another issue

Comments

@geewit
Copy link

geewit commented Feb 22, 2023

version 2.7.8
@transactional(rollbackFor = Exception.class)
@Modifying(flushAutomatically = true, clearAutomatically = true)
@query(value = "delete u from sys_user u left join sys_org_user_rel rel on rel.user_id = u.user_id where rel.org_struct_id =:orgId and u.user_id = :userId", nativeQuery = true)
void deleteByOrgIdAndId(@param("orgId") long orgId, @param("userId") long userId);
will cause NullPointerException during starting.
org.springframework.data.jpa.repository.query.QueryUtils.createCountQueryFor(QueryUtils.java:607)

but version 2.7.7 is ok.

@geewit geewit changed the title native delete query cause NullPointerException version 2.7.8 native delete query cause NullPointerException Feb 22, 2023
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 22, 2023
@wstrzalka
Copy link

wstrzalka commented Feb 22, 2023

I have the same - the issue seems to be introduced in this commit 64b5a22
and the problematic statements is variable.contains(",") when variable is null in this line

if (nativeQuery && (variable.contains(",") || "*".equals(variable))) {

@fiveOO
Copy link

fiveOO commented Feb 23, 2023

Same for me.
Triggered by

@Query(value = "call NEXT VALUE FOR order_seq", nativeQuery = true)
BigInteger getNextOrderNo();

in an HSQLDB specific JpaRepository

@mp911de
Copy link
Member

mp911de commented Feb 23, 2023

Closing as duplicate of #2812

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2023
@mp911de mp911de added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

5 participants