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 DAO code when visibility of a field is changed to private #15183

Closed
lukaseder opened this issue Jun 7, 2023 · 2 comments

Comments

@lukaseder
Copy link
Member

There's a test that makes the visibility of a field private:

<forcedType>
    <visibilityModifier>PRIVATE</visibilityModifier>
    <includeExpression>VISIBILITY\.PRIVATE</includeExpression>
</forcedType>

That leads to a compilation error in the generated DAO, which refers to the columns as follows:

    /**
     * Fetch records that have <code>PRIVATE BETWEEN lowerInclusive AND
     * upperInclusive</code>
     */
    public List<org.jooq.codegen.test.visibility.db.tables.pojos.Visibility> fetchRangeOfPrivate(Integer lowerInclusive, Integer upperInclusive) {
        return fetchRange(Visibility.VISIBILITY.PRIVATE, lowerInclusive, upperInclusive);
    }

    /**
     * Fetch records that have <code>PRIVATE IN (values)</code>
     */
    public List<org.jooq.codegen.test.visibility.db.tables.pojos.Visibility> fetchByPrivate(Integer... values) {
        return fetch(Visibility.VISIBILITY.PRIVATE, values);
    }

We mustn't generate these utility methods if the visibility is non-public. If the visibility was package private or protected, we could still check if the DAO is in the same package as the table.

@lukaseder
Copy link
Member Author

The feature has been introduced in jOOQ 3.17: #13432

lukaseder added a commit that referenced this issue Jun 7, 2023
visibility of a field is changed to private
lukaseder added a commit that referenced this issue Jun 7, 2023
visibility of a field is changed to private
lukaseder added a commit that referenced this issue Jun 7, 2023
visibility of a field is changed to private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant