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

Compilation error in generated static entity view metamodel in case of singular Map #1881

Closed
Mobe91 opened this issue Mar 26, 2024 · 0 comments · Fixed by #1882
Closed

Compilation error in generated static entity view metamodel in case of singular Map #1881

Mobe91 opened this issue Mar 26, 2024 · 0 comments · Fixed by #1882

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Mar 26, 2024

Description

Given the following entity view

@EntityView(MyEntity.class)
interface MyView {
  @MappingSingular
  Map<String, String> getSingularMap();
}

Generating a metamodel for this view using blaze-persistence-entity-view-processor results in invalid Java code that fails compilation.

More precisely, the following is generated:

public AttributePath<T, Map<String java.lang.String>, Map<String java.lang.String>> singularMap() {
    MethodSingularAttribute<ContainerTemplateDto, Map<String java.lang.String>> attribute = LocationOverviewContainerDtoImplContainerTemplateDto_.externalReferences;
    return attribute == null ? getWrapped().<Map<String java.lang.String>>get("singularMap") : getWrapped().get(attribute);
}

Expected behavior

Valid metamodel code is generated.

Actual behavior

The generated metamodel code does not compile.

Steps to reproduce

Environment

Version: 1.6.11

@Mobe91 Mobe91 added this to the 1.6.12 milestone Mar 26, 2024
@Mobe91 Mobe91 self-assigned this Mar 26, 2024
Mobe91 added a commit to Mobe91/blaze-persistence that referenced this issue Mar 26, 2024
Mobe91 added a commit to Mobe91/blaze-persistence that referenced this issue Mar 26, 2024
Mobe91 added a commit to Mobe91/blaze-persistence that referenced this issue Mar 26, 2024
beikov pushed a commit to beikov/blaze-persistence that referenced this issue Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment