Looks awesome, may give a look to it tomorrow when snapshot is updated. On Wednesday, March 26, 2025 at 11:35:21 AM UTC+1 [email protected] wrote:
> For the record, jOOQ 3.21 will offer a ContextPolicyProvider subtype, > which is capable of receiving a new PolicyContext object that gives access > to the rendering context: > https://github.com/jOOQ/jOOQ/issues/16311 > > It should be possible to communicate with other SPIs via this type in case > Spring's injection capabilities do not suffice (though, they should IMO). > > On Tuesday, March 25, 2025 at 1:48:28 PM UTC+1 [email protected] > wrote: > >> Got you, I'll create my custom policyprovider. >> Thanks for the idea. >> >> On Tuesday, March 25, 2025 at 1:40:17 PM UTC+1 [email protected] wrote: >> >>> You don't have to create new configurations all the time. Just implement >>> your own PolicyProvider that creates the policies on the fly. Try it, >>> measure it. >>> >>> If you're afraid (due to measurements) that overheads will be too high, >>> you can also work with thread locals or whatever context provider to access >>> your authenticated user from the policy predicate. >>> >>> On Tue, Mar 25, 2025 at 12:42 PM 'Joaquin' via jOOQ User Group < >>> [email protected]> wrote: >>> >>>> what's the overhead to it? is it fine to pass the policy provider >>>> deriving the configuration everytime? >>>> >>>> >>>> On Monday, March 24, 2025 at 9:15:36 AM UTC+1 [email protected] wrote: >>>> >>>>> Just create your policies at runtime rather than at configuration >>>>> time. >>>>> >>>>> On Thu, Mar 20, 2025 at 9:40 AM 'Joaquin' via jOOQ User Group < >>>>> [email protected]> wrote: >>>>> >>>>>> Hello everyone, >>>>>> I created an inherited policy with jooq, but it seems to get evaluted >>>>>> during initialization with Spring Boot. >>>>>> >>>>>> this is my setup: >>>>>> >>>>>> @Bean >>>>>> DefaultConfigurationCustomizer >>>>>> defaultConfigurationCustomizer(CustomPolicyProvider >>>>>> customPolicyProvider) { >>>>>> return configuration -> { >>>>>> configuration.setRecordListener(new JooqRecordListener()); >>>>>> >>>>>> configuration.settings().setEmulateNestedRecordProjectionsUsingMultisetEmulation( >>>>>> true); >>>>>> configuration.setPolicyProvider(customPolicyProvider); >>>>>> }; >>>>>> } >>>>>> >>>>>> the constructor of my policyProvider is done this way: >>>>>> >>>>>> public CustomPolicyProvider(AuthenticationFacade >>>>>> authenticationFacade) { >>>>>> this.append(new CustomPolicy<>(TABLE, () -> TABLE.child().ID.eq( >>>>>> authenticationFacade.getAuthenticatedUser().userId())), ANOTHER_TABLE >>>>>> .child())); >>>>>> } >>>>>> >>>>>> what happens is that this fails because the authenticationFacade is >>>>>> actually null during startup which makes sense, this works properly when >>>>>> I'm not using an inherited policy. >>>>>> >>>>>> any ideas on how to get it working? >>>>>> >>>>>> Thanks >>>>>> >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "jOOQ User Group" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to [email protected]. >>>>>> To view this discussion visit >>>>>> https://groups.google.com/d/msgid/jooq-user/293ed01d-6a53-4e73-8239-d5378f4305efn%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/jooq-user/293ed01d-6a53-4e73-8239-d5378f4305efn%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "jOOQ User Group" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> >>> To view this discussion visit >>>> https://groups.google.com/d/msgid/jooq-user/34fc7699-e1e5-4775-83ca-f68e9010d005n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/jooq-user/34fc7699-e1e5-4775-83ca-f68e9010d005n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/jooq-user/b666c3e4-5c00-4bc6-8967-8a688ae8b80cn%40googlegroups.com.
