Hi Samir, Thanks for your question. I will comment inline
2016-10-25 1:03 GMT+02:00 Samir Faci <[email protected]>: > I'm trying to override the primary key for a specific table using Jooq > 3.8.1. > > My Maven configuration looks something along these lines: > > <generator> > <generate> > <pojos>true</pojos> > </generate> > <name>org.jooq.util.DefaultGenerator</name> > <database> > > <name>org.jooq.util.postgres.PostgresDatabase</name> > <includes>${jooq-includes}</includes> > <excludes/> > > <syntheticPrimaryKeys> > > ui\.advertiser_default_setting\.COLUMN(2|3|4|5|6|9) > </syntheticPrimaryKeys> > > <schemata> > <schema> > <inputSchema>ad</inputSchema> > </schema> > <schema> > <inputSchema>ui</inputSchema> > </schema> > > </schemas> > ............. etc > > > I also had some questions about the usage of: > > <overridePrimaryKeys>MY_UNIQUE_KEY_NAME</overridePrimaryKeys> > > is the unique name, the name of the unique index name? I tried doing > something like: > > <overridePrimaryKeys>advertiser_default_setting_unique_index</ > overridePrimaryKeys> > > neither approach worked. > Good point. This will match the unique *constraint* name, not index name. Depending on your database, and how you created the unique constraint, the two things may be different. Note that some databases allow users to specify a unique index without any explicit constraint. That is a bit weird, as the index becomes the constraint. In that case, jOOQ's overridePrimaryKeys cannot match them (if I'm not mistaken) > 2. I was also wondering how you would list more then one item. Is it > pipe delimited like the includes/excludes? > All of these configuration elements are just ordinary Java regular expressions, so yes, the pipe symbol creates "unions" of matched sets of items. I hope this helps, 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/d/optout.
