Hello Lewis,

> OK, with that said, basically I need to find a replacement for
> CreateTableQuery [3], I understand that I should be accessing the
> implementation through o.j.util.Factory, however (due to my unfamiliarity
> with the JOOQ API at this stage) I can only locate delete, inset, results,
> selects, simple selects & updates... oh and of course query and query part's
> :0)

As I mentioned to you before on the GORA news groups, jOOQ currently
does not support DDL statements. I found the relevant mail here:
http://mail-archives.apache.org/mod_mbox/gora-dev/201201.mbox/%3ccab4elo5y666xtnnbeyqojypu3rwvwldcdxcsx2uzlepzapt...@mail.gmail.com%3E

Adding support for DDL statements is on the jOOQ roadmap:
https://sourceforge.net/apps/trac/jooq/ticket/883

I've found a sample OSS project on Google Code using jOOQ for DDL:
http://lukaseder.wordpress.com/2011/10/27/jooq-in-the-wild/

Currently, your only option is to do something like this:
factory.execute(
  "CREATE TABLE IF NOT EXISTS backups (" +
    "id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
    "run_time DATETIME NOT NULL, " +
    "num_entries INT NULL" +
    ")");

As you can see, this makes use of MySQL syntax (AUTO_INCREMENT).
Unfortunately, I've had no idea yet, how to formalise even simple DDL
features into a common API.

> I need to replace/alternative getter and setter implementations which
> (privately) set a column constraint, which can then used when we
> createSchema() in our SqlStore.

Can you elaborate? I'm not sure what you mean...

> As I'm picking the JOOQ API up at a reasonably random stage rather than
> starting at the beginning (which I'll be doing in a couple of weeks), I
> would really appreciate any help anyone can throw in my direction at this
> stage. It's early days, but it looks like I'll be around for a while.

Any questions welcome!

Cheers
Lukas

Reply via email to