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?