jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
385 stars 53 forks source link

ReactiveRXGenericQueryExecutor's newInstance() returns wrong class type #185

Open ashertarno opened 3 years ago

ashertarno commented 3 years ago

In ReactiveRXGenericQueryExecutor the following method is creating a new instance once a new transaction is created:

protected io.reactivex.functions.Function<Transaction, ? extends ReactiveRXGenericQueryExecutor> newInstance(SqlConnection conn) { return transaction -> new ReactiveRXGenericQueryExecutor(configuration(),conn,transaction); }

While the function in method's return type should return <? extends ReactiveRXGenericQueryExecutor> the method returns ReactiveRXGenericQueryExecutor which breaks an option to subclass ReactiveRXGenericQueryExecutor.

jklingsporn commented 3 years ago

Thank you for pointing that out. Changing the API to what you suggested would break the current contract and thus I am a bit reluctant to do it right away. Have you tried to use delegation instead of inheritance to reach your goal?

ashertarno commented 3 years ago

@jklingsporn thanks for the prompt response. unfortunately delegation doesn't solve my need to customize some things. this is also an old code that used a previous version (vertx3 based). i do have a workaround, but it's pretty awkward.