got it, thanks again

On Saturday, December 7, 2013 4:05:17 AM UTC-8, Lukas Eder wrote:
>
>
> 2013/12/6 bruce buchanan <[email protected] <javascript:>>
>
>> hey thanks for getting back to me
>>
>> so the jaxb world is completely new to me, unless you care to walk me 
>> thru the process of creating a Configuration object from my codegen cfg xml 
>> file, and I'm guessing you dont have the time, looks like I'm back to using 
>> the command line
>>
>
> Don't worry about the package name. You can load the Configuration object 
> from XML using JAXB, or you can construct it programmatically:
>
> Configuration c = new Configuration()
>     .withGenerator(new Generator()
>         .withDatabase(...)
>     );
>
> The methods are generated from XJC, so there is a 1:1 mapping between the 
> XSD / XML format and the Java API.
>  
>
>> here's the thing: I wound up experimenting w/ using the codegen tool 
>> programatically because I can create a jdbc connection to a sqlite file no 
>> problem in java, but when I run the codegen tool from the command line, the 
>> path to the sqlite file I use in java doesnt work from inside my codegen 
>> cfg xml file
>>
>> I keep getting
>>
>> Cannot read [my cfg]xml. Error : invalid database address: 
>> "jdbc:sqlite:[path to sqlite db file here]"
>>
>> the path I use inside java to open a connection 
>> "/Users/bruce/Documents/UCB/new 
>> dev/data_viewer/sqlite/ceo_template.sqlite" works fine
>>
>> but it seems the syntax the codegenerator needs is different? note the 
>> space in the path.. I've tried escaping it, I've tried all variations... 
>> dont see any examples anywhere of people doing this... I think sqlite is 
>> the only db to require a file path as opposed to a network url
>>
>> I do have everything in one folder, would love to use a relative path... 
>> "ceo_template.sqlite", "/ceo_template.sqlite" or "./ceo_template.sqlite"
>>
>
> Hmm, I'm not sure how to resolve this issue in your environment, but I'm 
> sure someone else must've done it before. And if this is such a hassle, why 
> not replace the whitespace by an underscore?
>
> meanwhile I do have the DDL script that created this db handy -- is there 
>> a way to just work from that? 
>>
>
> No, jOOQ's code generator reads database metadata directly from the 
> database. There is currently no way to read metadata from a DDL file.
>  
>
>> do you suppose sqlite is just too much of a hassle in general and I 
>> should move to something like derby or H2? I do have read in data from 
>> sqlite files but that doesnt have to be my internal format
>>
>
> I have no particular opinion on that. You should choose the best database 
> for your use cases.
>  
>
>> ie I could start with a new empty instance of say, H2, run my DDL -- but 
>> how would I run the codegenerator against an in process db?
>>
>
> The code generator obviously has to be able to access the database 
> somehow. An H2 in process db might not be exposeable to jooq-codegen. You 
> could, of course, duplicate the DDL into an H2 file-based db or db server, 
> just for the code generation.
>  
>
>> anyway sorry bother you with the little stuff
>>
>
> no worries :-)
>
> Cheers
> Lukas
>

-- 
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