Exclude views from the code generation MYSQL

150 views
Skip to first unread message

lubo mihailov

unread,
Jun 13, 2022, 12:22:00 PM6/13/22
to jOOQ User Group
Hi
i want to exclude all  the views  when i generate the code
but with no result.
Probably i missed something but i cant  make it to skip them
i even add them manually  but i still generate all the views
Example::
tabe_schema.viewname_1|tabe_schema.viewname_2|tabe_schema.viewname_2 ...
And i still cant make it work.
Where i do it wrong.

Lukas Eder

unread,
Jun 13, 2022, 12:31:01 PM6/13/22
to jOOQ User Group
Hello,

Can you please share the exact code generation configuration?
Also, please do check if you picked the correct name case (upper / lower)

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/ccb86645-a51b-461c-a55c-b07b161fe233n%40googlegroups.com.

lubo mihailov

unread,
Jun 13, 2022, 12:54:08 PM6/13/22
to jOOQ User Group
Hi
this is my configuration
<executions>
    <execution>
        <id>generate-mysql-schemaName</id>
        <phase>generate-sources</phase>
        <goals>
            <goal>generate</goal>
        </goals>
        <configuration>
            <jdbc>
                <driver>${driverName}</driver>
                <url>${url}</url>
                <user>${user}</user>
                <password>${password}</password>
            </jdbc>
            <generator>
                <database>
                    <includes>.*</includes>
                    <excludes>SQL [
                        SELECT GROUP_CONCAT(table_schema,'.', table_name,'|')
                        FROM information_schema.views;
                        <!--
                SELECT CONCAT(table_schema,'.', table_name,'|')
                     FROM information_schema.views
                SELECT CONCAT(table_schema,'.', table_name,'|')
                        FROM information_schema.tables;
                  SELECT GROUP_CONCAT(table_schema,'.', table_name,'|')
                        FROM information_schema.tables;
                        -->
                    </excludes>
                    <inputSchema>inputSchema</inputSchema>
                </database>
                <target>
                    <packageName>com.inputSchema</packageName>
                    <directory>${someDir}</directory>
                </target>
                <generate>
                    <sources>true</sources>
                    <sourcesOnViews>false</sourcesOnViews>
                </generate>
            </generator>
        </configuration>
    </execution>
</executions>

Lukas Eder

unread,
Jun 13, 2022, 2:38:27 PM6/13/22
to jOOQ User Group
Oh, I see, you took inspiration from this issue here, then:

But the feature hasn't been implemented yet, so you can't use that approach... You could run such a query with manual code generation configuration:


lubo mihailov

unread,
Jun 13, 2022, 4:40:11 PM6/13/22
to jOOQ User Group
Thanks will try it
Is there any way to add  multiple views  manually in  <excludes>  </excludes>  until find a way to do it with the code programmatic 

Lukas Eder

unread,
Jun 13, 2022, 5:53:02 PM6/13/22
to jOOQ User Group
Well, it's a regular expression, so just add view1|view2|view3|...

Reply all
Reply to author
Forward
0 new messages