avaje / avaje-inject

Dependency injection via APT (source code generation) ala "Server-Side Dagger DI"
https://avaje.io/inject
Apache License 2.0
240 stars 24 forks source link

Q: Feature: @Transactional #17

Closed yaskor closed 5 years ago

yaskor commented 5 years ago

First of all, great library. Only thing missing (for me) is @Transactional. One could define a DataSource and a TransactionManager and dinject would inject the transaction code into the annotated methods.

I have allready written something with an functional aproch like:

transactionManager.doInTransaction(()->{
    foo1();
    foo2();
})

But a annotation would be much nicer...

rbygrave commented 5 years ago

Yes there are roughly 2 things I see missing: 1) @Transational 2) Configuration / replacement for @Value

I personally use Ebean ORM (https://ebean.io) that has @Transactional built in so adding some generic AOP support that would include @Transactional could be done but personally isn't a priority yet.

Note that I am the main contributor to Ebean ORM.

rbygrave commented 5 years ago

I'll close this.