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

Fieldgenerator: Imports of types with duplicate simple name yields generated code to render erroneously #32

Closed
julgus opened this issue Jun 30, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@julgus
Copy link
Member

julgus commented Jun 30, 2020

If entity has columns using the same simple name, as:

    @Column(name = "release_date", nullable = false, columnDefinition = "DATE")
    @Temporal(TemporalType.DATE)
    private java.util.Date releaseDate;

    @Column(name = "release_time", nullable = false, columnDefinition = "DATE")
    private java.sql.Date releaseTime;

The generated code cannot be compiled as the reference type is not rendered properly.

public static final Date> releaseDate = ComparableField.create(
     Film.class,
     "release_date",
     Film::getReleaseDate,
     false
); 

What I know so far is that this error cannot be derived to the Speedment generator nor the parsing of types.

@julgus julgus added the bug Something isn't working label Jun 30, 2020
@julgus julgus self-assigned this Jun 30, 2020
@julgus
Copy link
Member Author

julgus commented Jul 1, 2020

I was wrong about the error not occurring in Speedment. Bug located in codegen's utility class Formatting where the method shortName() erroneously concatenated away everything before the last dot. This has been fixed on Speedment's development branch.

@minborg minborg closed this as completed Sep 1, 2020
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

2 participants