Skip to content

Store AMP autocomplete excludes items without VMP due to implicit inner join #18459

@coderabbitai

Description

@coderabbitai

Issue Description

The completeAmpDto() method in StoreAmpController.java uses an implicit inner join on VMP associations, which silently excludes Store AMP items that lack a VMP from autocomplete results.

Context

This issue was identified during review of PR #18452.

Affected method: completeAmpDto(String query) in src/main/java/com/divudi/bean/store/StoreAmpController.java (around lines 634-641)

Related comment: #18452 (comment)

Related PR: #18452

Technical Details

The current JPQL query uses a.vmp.id and a.vmp.name in the projection, which creates an implicit inner join. This means any Store AMP without an associated VMP will be filtered out from autocomplete results.

This is a data integrity concern if legacy Store AMPs exist without VMP associations, as users won't be able to find or select them via autocomplete.

Note: The same issue exists in the getAmpDtos() method as well.

Expected Behavior

Store AMPs without VMP associations should still appear in autocomplete results and listings.

Reported By

@buddhika75

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions