An alternative is to use an embedded database, H2, for code generation 
during the build. This requires maintaining a set of migration scripts for 
H2 (test) and MySQL (prod), due to dialect differences. It works pretty 
well and though some developers dislike the small amount of duplication no 
one prefers the alternative of checking in generated code. See this 
example<https://github.com/ben-manes/gradle-jooq-plugin/tree/master/example>using
 gradle.

On Sunday, August 11, 2013 12:18:18 AM UTC-7, Lukas Eder wrote:
>
> Hi Dan,
>
> This has been brought up a couple of times on this user group, and I 
> completely agree that an additional layer of indirection for source code 
> generation would be very nice. The ideal would be to be able to generate 
> any of these:
>
> - DB metadata -> Java
> - DB metadata -> XML (or other formats)
> - XML -> Java
>
> Such a feature request is on the long-term strategic roadmap.
> Right now, I suspect you'll need to check in the generated sources, if 
> developers don't have access to the database. Other users on this group 
> might have found other strategies to solve this problem...
>
> Cheers
> Lukas
>
> 2013/8/11 Dan <[email protected] <javascript:>>
>
>> Hi everyone,
>>
>> I'd like to be able to be able to use jOOQ generated code without 
>> necessarily needing access to a database to generate it, so a developer 
>> would not need to have their database set up in order to get a working 
>> checkout that compiles. One option is to check the generated source files 
>> into the repository. Another idea is to somehow "fake" the database layer 
>> during generation - for example this would involve getting jOOQ to run a 
>> real introspection on a real database once, and then only check into source 
>> control some representation of the schema information that it has 
>> extracted, which could subsequently be used for code generation without a 
>> database connection. Is something like this possible?
>>
>> I've tried looking around the documentation + code + mailing list and 
>> couldn't find anything, please forgive me if I've missed something obvious 
>> :)  I toyed with the idea of writing another implementation of "Database" 
>> either manually or by recording the output of an actual session but both 
>> don't seem worth the trouble (vs just stomaching the distasteful act of 
>> checking the generated code into source control).
>>
>> Dan
>>
>> -- 
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.

Reply via email to