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

Expose SqlObject dispatch machinery for public use #455

Closed
qualidafial opened this issue Aug 21, 2016 · 3 comments
Closed

Expose SqlObject dispatch machinery for public use #455

qualidafial opened this issue Aug 21, 2016 · 3 comments
Assignees

Comments

@qualidafial
Copy link
Member

qualidafial commented Aug 21, 2016

I propose making the following SqlObject types public:

  • Handler
  • @SqlMethodAnnotation and HandlerFactory
  • @SqlMethodDecoratingAnnotation and HandlerDecorator

This will allow users and library authors to create their own SQL method handlers and decorators, which will in turn make caching feasible as a bolt-on option for users who want it, although there may be other use cases we haven't thought of.

We should also introduce a way of specifying order for when there are multiple decorators. My gut tells me that a static @Priority annotation is not the best approach, since users might want different ordering in different scenarios.

@qualidafial qualidafial added this to the JDBI 3 Beta blocker milestone Aug 21, 2016
@qualidafial
Copy link
Member Author

For multiple decorators, one approach might be:

@interface DecoratorOrder {
  Class<? extends Annotation>[] value();
}

Thus, in a sql object:

@FooDecorator
@BarDecorator
@DecoratorOrder(BarDecorator.class, FooDecorator.class)
List<Thing> listAllTheThings();

If you don't specify an order, then decorator order is undefined.

@stevenschlansker
Copy link
Member

OK by me.

@qualidafial
Copy link
Member Author

Fixed in #458

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

No branches or pull requests

2 participants