Skip to content

Conversation

@anibalanto
Copy link

@anibalanto anibalanto commented May 28, 2024

Hello, I want simplify DynamicEntityGraph configuration.
One option today is:

    Product product =
        productRepository
            .findById(
                1L,
                ProductEntityGraph.____()
                    .brand()
                    .____
                    .category()
                    .____
                    .maker()
                    .country()
                    .____
                    .____())
            .orElseThrow(RuntimeException::new);

  }

I add an option to do the same:

    Product product =
        productRepository
            .findById(
                1L,
                ProductEntityGraph.inic_(
                    productEG ->
                        productEG
                            .brand_()
                            .category_()
                            .maker_(makerEG -> 
                                makerEG
                                    .country_())))
            .orElseThrow(RuntimeException::new);

@reda-alaoui
Copy link
Member

@anibalanto I don't understand the expected gains with this PR. Could you give more details?

@anibalanto anibalanto changed the title Add optinal DynamicEnityGraph configuration mode Add optinal DynamicEntityGraph configuration mode May 28, 2024
@anibalanto
Copy link
Author

anibalanto commented May 28, 2024

Hello @reda-alaoui ! I update my first description.

Thank!

@reda-alaoui
Copy link
Member

reda-alaoui commented May 28, 2024

@anibalanto , I don’t find the added option more readable. IMO, adding it to the project will lead to cluttered code in consuming projects.

If you want/need an extension point to plug a custom EG style defined outside of this project, I’d welcome it. But maybe you should just create a full annotation processor on your side without using the one defined here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants