Sequence generation not working

9 views
Skip to first unread message

Simon Williams

unread,
Jun 16, 2016, 9:28:52 AM6/16/16
to jOOQ User Group
Hi,

I have a sequence in my database, but it's not getting created by the jooq generator? but all my tables and keys are generated fine?

I'm using Jooq 3.5.0

The schema.xml contains this:

<sequence>
<sequence_schema/>
<sequence_name>ticket_id_seq</sequence_name>
<data_type>BIGINT</data_type>
</sequence>


and my pom.xml has:
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<executions>
<execution>
<id>generate-postgres</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generator>
<name>org.jooq.util.DefaultGenerator</name>
<database>
<name>org.jooq.util.xml.XMLDatabase</name>
<properties>
<property>
<key>dialect</key>
<value>POSTGRES</value>
</property>
<property>
<key>xml-file</key>
<value>
${basedir}/target/generated-resources/xml/xslt/jooq-schema.xml
</value>
</property>
</properties>
<inputSchema>public</inputSchema>
</database>
<generate>
<deprecated>false</deprecated>
<instanceFields>true</instanceFields>
<pojos>true</pojos>
<pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>
<validationAnnotations>true</validationAnnotations>
</generate>
<target>
<packageName>my.datastore.generated</packageName>
<directory>target/generated-sources/jooq-postgres</directory>
</target>
</generator>
</configuration>
</execution>
</executions>
</plugin>

any thoughts?

Thanks in advance,

Simon

Lukas Eder

unread,
Jun 17, 2016, 3:27:55 AM6/17/16
to jooq...@googlegroups.com
Hi Simon,

Thank you very much for your enquiry. Your sequence has to be in a schema, probably in public. I suspect that will solve the issue for you:

<sequence>
<sequence_schema>public</sequence_schema>
<sequence_name>ticket_id_seq</sequence_name>
<data_type>BIGINT</data_type>
</sequence>

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

Simon Williams

unread,
Jun 17, 2016, 3:49:37 AM6/17/16
to jOOQ User Group
Thanks Lukas, that appears to solve the situation. I just need to work out how to get it into the schema automatically as it's generated from a vertabelo export, but that's a whole other issue.

Lukas Eder

unread,
Jun 17, 2016, 3:50:27 AM6/17/16
to jooq...@googlegroups.com
I sense an XSLT-based solution here :)
Reply all
Reply to author
Forward
0 new messages