Re: Multiple schemas and <syntheticPrimaryKeys>

7 views
Skip to first unread message

Lukas Eder

unread,
Jan 19, 2018, 9:23:44 AM1/19/18
to jooq...@googlegroups.com
Hi Matt,

This one should work: 
<syntheticPrimaryKeys>.*\.view\.id</syntheticPrimaryKeys>

Alternatively, I often write this instead (case insensitive and schema optional):
<syntheticPrimaryKeys>(?i:(.*\.)?view\.id)</syntheticPrimaryKeys>

Or, if all your ID columns are primary keys, you can do this as well (use an unqualified name):
<syntheticPrimaryKeys>(?i:id)</syntheticPrimaryKeys>

These ones should work as well, for schemas names of length 1+ (..*) or 2+ (..+), but there's no value over the previous expression:
<syntheticPrimaryKeys>..*\.view\.id</syntheticPrimaryKeys>
<syntheticPrimaryKeys>..+\.view\.id</syntheticPrimaryKeys>

This one doesn't work, you got a dangling * character:
<syntheticPrimaryKeys>*\.view\.id</syntheticPrimaryKeys>

Now, I don't know why the configurations didn't work in your case... you could debug through the implementation and set a breakpoint in AbstractDatabase.syntheticPrimaryKeys(DefaultRelations) to see what's going on.

Thanks,
Lukas

2018-01-19 13:36 GMT+01:00 <hem...@gmail.com>:
Hey Lukas.

I have a multi-schema set up, and am attempting to create an index so a DAO may be generated for a View.
I'm using MySQL if it helps, but when I enter

 <syntheticPrimaryKeys>schema\.view\.id</syntheticPrimaryKeys>

The DAO generates, but if I use (and I understand it's regex with dot prefixing the view and column)

<syntheticPrimaryKeys>.*\.view\.id</syntheticPrimaryKeys>
<syntheticPrimaryKeys>..*\.view\.id</syntheticPrimaryKeys>
<syntheticPrimaryKeys>*\.view\.id</syntheticPrimaryKeys>
<syntheticPrimaryKeys>..+\.view\.id</syntheticPrimaryKeys>

The generator just outputs "Skipping DAO generation". Is this possible to have a wildcard schema for syntheticPrimaryKeys, if so please let me know how I am failing.

Regards

Matt

--
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 jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages