Hi Lukas,

Thanks for your swift reply. I apologize for not being much clear in the 
question. I do not have any problem with DSLContext being generated afresh 
every time. The concern I have is that the generation of DSLContext is now 
rigid and cannot be extended to any other generation pattern. e.g to use a 
decorator instead. guice-persist-jooq gives a way to inject DSLContext to 
any class. So just while guice binding, I can choose which implementation I 
want to use (https://github.com/supercargo/guice-persist-jooq). If this 
flexibility, to pass the intended implementation as an overridden method 
result or any other mechanism, could be implemented, then I won't need to 
modify the generated DAO code much. If this is not possible or too much 
impact, then I always have an option to inject the configuration instead, I 
guess.

And lastly, Thank you for this awesome library. It really is a wonderful 
way out for the guys like me to whom JPA seems to be an overkill.

Thanks,
Sachin 

On Friday, 9 October 2015 14:20:33 UTC+5:30, Lukas Eder wrote:
>
> Hello Sachin,
>
> DSLContext doesn't really have a lifecycle (or state) of its own. It's 
> just a wrapper for org.jooq.Configuration, which contains all the 
> interesting stuff, enhancing it with DSL entry points - just like the 
> static DSL utility class. As such, it doesn't matter that it is generated 
> afresh all the time.
>
> Generated DAOs have a constructor that accepts a Configuration. Or, you 
> can use DAOImpl.setConfiguration().
>
> I hope this helps,
> Lukas
>
> 2015-10-08 21:55 GMT+02:00 <[email protected] <javascript:>>:
>
>> Hello all,
>>
>> I am new here so please forgive if I am not really clear on my question 
>> or I have missed any important details.
>>
>> I am trying to integrate Ninja Framework and JOOQ 
>> using guice-persist-jooq, I created a Postgres DB and generated various 
>> classes(DAO, Model, Pojo etc) using jooq-codegen I noticed that the 
>> generated DAO always create a new DSLContext in using() method in DAOImpl. 
>> I am planing to inject DSLContext using guice and use it somehow in 
>> generated DAOs. I could not find any way. Could you please help.
>>
>> Thanks,
>> Sachin
>>
>> -- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to